diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-24 16:35:44 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-24 16:35:44 +0100 |
commit | 54aa9bfe8a3815229b5b79f28a4fcc9e0e32fdbc (patch) | |
tree | 0d82afb16d37c78a90257bb53b03e2c321c584db /ctrack/users/tests | |
parent | 84e5076fa235be060f99f38dec59ddd0f9ca4dbc (diff) |
working on test_profile_view_contains_organisation_information - FAILING
Diffstat (limited to '')
-rw-r--r-- | ctrack/users/tests/test_views.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py index 3e7fbf7..33ab238 100644 --- a/ctrack/users/tests/test_views.py +++ b/ctrack/users/tests/test_views.py @@ -2,7 +2,7 @@ import pytest from django.test import RequestFactory from ctrack.users.models import User -from ctrack.users.views import UserRedirectView, UserUpdateView +from ctrack.users.views import UserDetailView, UserRedirectView, UserUpdateView pytestmark = pytest.mark.django_db @@ -44,3 +44,17 @@ class TestUserRedirectView: view.request = request assert view.get_redirect_url() == f"/users/{user.username}/" + + +def test_profile_view_contains_organisation_information(user: 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. + """ + 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) + assert response.status_code == 300 |