From bb21bbe9a38a9d3fc129716525514189ffc4bb7f Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Sat, 9 May 2020 18:21:54 +0530 Subject: Add more tests for course_students view --- yaksh/test_views.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'yaksh/test_views.py') diff --git a/yaksh/test_views.py b/yaksh/test_views.py index b2e62af..be0f7a3 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -3530,6 +3530,17 @@ class TestCourseStudents(TestCase): response = self.client.get(url) self.assertEqual(response.status_code, 404) + def test_course_students_where_user_is_not_moderator(self): + self.client.login( + username=self.student1, + password=self.student1_plaintext_pass + ) + url = reverse('yaksh:course_students', kwargs={ + 'course_id': self.user1_course.id, + }) + response = self.client.get(url) + self.assertEqual(response.status_code, 404) + def tearDown(self): self.user1.delete() self.user2.delete() -- cgit