From a9d29f8ae6b558c608b9bdf9f7260873a6ee3859 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 25 May 2020 17:15:35 +0100 Subject: added to README and enhanced view test --- ctrack/users/tests/test_views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ctrack/users/tests/test_views.py') diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py index 7c1d33c..7c2c8be 100644 --- a/ctrack/users/tests/test_views.py +++ b/ctrack/users/tests/test_views.py @@ -56,7 +56,7 @@ def test_profile_view_contains_organisation_information(person): user = get_user_model().objects.create_user( username="testy", email="testy@test.com", password="test1020" ) - org = person.organisation.name + org_name = person.organisation.name stakeholder = Stakeholder.objects.create(person=person) user.stakeholder = stakeholder user.save() @@ -70,6 +70,11 @@ def test_profile_view_contains_organisation_information(person): assert response.context_data["user"].username == "testy" assert response.context_data["user"].is_stakeholder() is True assert response.context_data["user"].stakeholder.person.first_name == "Chinaplate" + assert ( + response.context_data["user"].stakeholder.person.get_organisation_name() + == org_name + ) + assert response.context_data["user"].get_organisation_name() == org_name # assert response.context_data["user"].stakeholder.person.first_name == "Chinaplate" -- cgit v1.2.3