Skip to content

Commit

Permalink
Update home view test
Browse files Browse the repository at this point in the history
Aligns with changes from #142
  • Loading branch information
cuducos committed Jul 13, 2021
1 parent b44ca6d commit 1897516
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions perfil/core/tests/test_home_view.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from json import loads
from django.shortcuts import resolve_url


def test_home_redirects_to_frontend(client):
def test_home_has_a_success_message(client):
response = client.get(resolve_url("home"))
assert 302 == response.status_code
assert "https://perfilpolitico.serenata.ai/" == response.url
assert 200 == response.status_code

data = loads(response.content.decode("utf-8"))
assert data["message"] == "API do Perfil Politico está online."
2 changes: 1 addition & 1 deletion perfil/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def home(request):
return JsonResponse({"data": "API do Perfil Politico está online."})
return JsonResponse({"message": "API do Perfil Politico está online."})


class CandidateListResource(DjangoResource):
Expand Down

0 comments on commit 1897516

Please sign in to comment.