Skip to content

Commit

Permalink
✅ Test reviewer must also be able to retrieve zaken
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm authored and svenvandescheur committed Jun 18, 2024
1 parent 76d10a9 commit adc0d60
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion backend/src/openarchiefbeheer/zaken/tests/test_viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_authenticated_without_permission(self):

self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_retrieve_all_zaken(self):
def test_retrieve_all_zaken_as_record_manager(self):
ZaakFactory.create_batch(4)

user = UserFactory(username="record_manager", role__can_start_destruction=True)
Expand All @@ -37,3 +37,15 @@ def test_retrieve_all_zaken(self):

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(data["count"], 4)

def test_retrieve_all_zaken_as_reviewer(self):
ZaakFactory.create_batch(4)

user = UserFactory(username="reviewer", role__can_review_destruction=True)

self.client.force_authenticate(user)
response = self.client.get(reverse("api:zaken-list"))
data = response.json()

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(data["count"], 4)

0 comments on commit adc0d60

Please sign in to comment.