diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/users/tests/test_views.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py index 6cbe9b6..ebc38d8 100644 --- a/ctrack/users/tests/test_views.py +++ b/ctrack/users/tests/test_views.py @@ -1,4 +1,5 @@ import pytest +from django.contrib.auth.models import Permission from django.test import RequestFactory from ctrack.core.views import home_page @@ -156,3 +157,12 @@ def test_user_received_persmission_denied_when_accessing_disallowed_page( assert request.user.is_staff is False response = OrganisationListView.as_view()(request) assert response.status_code == 403 + + +def test_user_gets_403(django_user_model, client, stakeholder): + user = django_user_model.objects.create_user(username="toss", password="knob") + user.stakeholder = stakeholder + user.save() + client.login(username="toss", password="knob") + response = client.get(path="https://localhost:8000/organisations") + assert response.status_code == 403 |