Пример #1
0
 def test_non_staff(self):
     """
     Verify that we cannot access cohorting_settings if we're a non-staff user.
     """
     request = RequestFactory().get("dummy_url")
     request.user = UserFactory()
     with self.assertRaises(Http404):
         cohorting_settings(request, unicode(self.course.id))
Пример #2
0
 def test_non_staff(self):
     """
     Verify that we cannot access cohorting_settings if we're a non-staff user.
     """
     request = RequestFactory().get("dummy_url")
     request.user = UserFactory()
     with self.assertRaises(Http404):
         cohorting_settings(request, unicode(self.course.id))
Пример #3
0
 def _verify_cohort_settings_response(self, expected_response):
     request = RequestFactory().get("dummy_url")
     request.user = AdminFactory()
     response = cohorting_settings(request, unicode(self.course.id))
     self.assertEqual(200, response.status_code)
     self.assertEqual(expected_response, json.loads(response.content))
Пример #4
0
 def _verify_cohort_settings_response(self, expected_response):
     request = RequestFactory().get("dummy_url")
     request.user = AdminFactory()
     response = cohorting_settings(request, unicode(self.course.id))
     self.assertEqual(200, response.status_code)
     self.assertEqual(expected_response, json.loads(response.content))