'Verify that the response was successful and matches the expected JSON payload.'

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