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))
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))