aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/test_views.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-25 17:29:41 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-25 17:29:41 +0100
commitd447a019cfe5d1e523b98c7bd4b488d445615a3f (patch)
tree1fab839d512df00c8354dea621643f86af1f9d93 /ctrack/users/tests/test_views.py
parent9a7a1b041246345275a17d89c160b3798be878fa (diff)
added an explanatory comment about the use of slug_field
Diffstat (limited to 'ctrack/users/tests/test_views.py')
-rw-r--r--ctrack/users/tests/test_views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py
index 7c2c8be..ca2d0c2 100644
--- a/ctrack/users/tests/test_views.py
+++ b/ctrack/users/tests/test_views.py
@@ -62,14 +62,18 @@ def test_profile_view_contains_organisation_information(person):
user.save()
factory = RequestFactory()
request = factory.get(f"/users/{user.username}")
+
# we have to do the following to simulate logged-in user
# Django Advanced Testing Topics
request.user = user
+
response = UserDetailView.as_view()(request, username=user.username)
assert response.status_code == 200
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"
+
+ # Two ways of getting the organisaton name
assert (
response.context_data["user"].stakeholder.person.get_organisation_name()
== org_name