Skip to content

Commit

Permalink
✅ [#2143] Add test for category visibility for staff users
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Feb 22, 2024
1 parent cffa683 commit 0533581
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/open_inwoner/pdc/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ def test_category_list_view_visibility_for_eherkenning_user(self):
list(response.context["object_list"]), [self.category2, self.category4]
)

def test_category_list_view_visibility_for_staff_user(self):
url = reverse("products:category_list")

user = UserFactory(is_staff=True)
self.client.force_login(user)

response = self.client.get(url)

self.assertEqual(response.status_code, 200)
self.assertEqual(
list(response.context["object_list"]),
[self.category1, self.category2, self.category3, self.category4],
)


@override_settings(ROOT_URLCONF="open_inwoner.cms.tests.urls")
class CategoryDetailViewTest(TestCase):
Expand Down

0 comments on commit 0533581

Please sign in to comment.