diff options
Diffstat (limited to 'ctrack/users')
-rw-r--r-- | ctrack/users/tests/test_functional.py | 3 | ||||
-rw-r--r-- | ctrack/users/tests/test_views.py | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/ctrack/users/tests/test_functional.py b/ctrack/users/tests/test_functional.py index 8d459a2..8fcc285 100644 --- a/ctrack/users/tests/test_functional.py +++ b/ctrack/users/tests/test_functional.py @@ -34,3 +34,6 @@ def test_user_can_log_in(browser, person, live_server): # On the other side, he sees some basic details about himself. assert "User: toss" in browser.title + + # Such as his own name in an H1 tag! + assert browser.find_element_by_tag_name("H1") == "Toss McBride" diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py index 0f57b36..e3aed6c 100644 --- a/ctrack/users/tests/test_views.py +++ b/ctrack/users/tests/test_views.py @@ -49,9 +49,9 @@ class TestUserRedirectView: def test_profile_view_contains_organisation_information(person, user): - """url: users/username - This is where users are redirected to when they log in and where I want to capture - information about the user - particularly if they are an OES user. + """ + This tests the context_data - not the rendered page... We'll do that in the + next test. """ org_name = person.organisation.name stakeholder = Stakeholder.objects.create(person=person) @@ -70,7 +70,7 @@ def test_profile_view_contains_organisation_information(person, user): assert response.status_code == 200 assert response.context_data["user"].username == user.username 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.first_name == "Toss" # Two ways of getting the organisaton name assert ( @@ -78,4 +78,4 @@ def test_profile_view_contains_organisation_information(person, user): == org_name ) assert response.context_data["user"].get_organisation_name() == org_name - assert response.context_data["user"].stakeholder.person.first_name == "Chinaplate" + assert response.context_data["user"].stakeholder.person.first_name == "Toss" |