aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/tests/test_views.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/ctrack/organisations/tests/test_views.py b/ctrack/organisations/tests/test_views.py
index ad0aad2..a77afcc 100644
--- a/ctrack/organisations/tests/test_views.py
+++ b/ctrack/organisations/tests/test_views.py
@@ -2,6 +2,7 @@ import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.test import RequestFactory
+from django.urls import reverse
from ctrack.caf.tests.factories import PersonFactory
from ctrack.organisations.models import Mode, Submode
@@ -65,8 +66,13 @@ def test_incident_report_create_view(stakeholder_user):
assert response.status_code == 200
+<<<<<<< HEAD
+def test_only_member_of_cct_user_group_can_view_a_single_person(
+ stakeholder_user, org_with_people, client
+=======
def test_only_member_of_cct_user_group_can_view_person_list(
stakeholder_user, org_with_people
+>>>>>>> b5fedc5817cde8732f47d608c6e8ccd274bb434e
):
role = RoleFactory.create()
submode = Submode.objects.create(
@@ -87,6 +93,19 @@ def test_only_member_of_cct_user_group_can_view_person_list(
group = Group.objects.create(name="cct_user")
stakeholder_user.groups.add(group)
+<<<<<<< HEAD
+
+ person_list_permission = Permission.objects.get(name="Can view person")
+ group.permissions.add(person_list_permission)
+
+ client.force_login(stakeholder_user)
+
+ response = client.get(reverse("organisations:people"))
+
+ # They get this permisson via the cct_user group
+ assert stakeholder_user.has_perm("organisations.view_person")
+ assert response.status_code == 200
+=======
person_list_permission = Permission.objects.get(name="Can view person")
group.permissions.add(person_list_permission)
@@ -95,3 +114,4 @@ def test_only_member_of_cct_user_group_can_view_person_list(
# They get this permisson via the cct_user group
assert stakeholder_user.has_perm("organisations.view_person")
+>>>>>>> b5fedc5817cde8732f47d608c6e8ccd274bb434e