From e2d25ecaf3985a3b8eb7026319a225d41945df9c Mon Sep 17 00:00:00 2001 From: soumyaa1804 Date: Fri, 24 Jan 2020 23:28:59 +0530 Subject: [PATCH] test_user_view_no_coordinators added in users/tests/ --- TWLight/users/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TWLight/users/tests.py b/TWLight/users/tests.py index dd559e9940..2976eba886 100644 --- a/TWLight/users/tests.py +++ b/TWLight/users/tests.py @@ -131,6 +131,16 @@ def test_editor_can_see_own_page(self): response = views.EditorDetailView.as_view()(request, pk=self.editor1.pk) self.assertEqual(response.status_code, 200) + def test_user_view_no_coordinators(self): + """Check that users with no coordinators can see their own pages.""" + get_coordinators().user_set.remove(self.user_coordinator) + factory = RequestFactory() + request = factory.get(self.url1) + request.user = self.user_editor + + response = views.EditorDetailView.as_view()(request, pk=self.editor1.pk) + self.assertEqual(response.status_code, 200) + def test_editor_cannot_see_other_editor_page(self): """Editors cannot see other editors' pages.""" factory = RequestFactory()