'Call a GET on `handler` for a given `course` and return its response as a dict.
Raise an exception if response status code is not as expected.'

def get_handler(self, course, cohort=None, expected_response_code=200, handler=cohort_handler):

    request = RequestFactory().get('dummy_url')
    request.user = self.staff_user
    if cohort:
        response = handler(request, unicode(course.id), cohort.id)
    else:
        response = handler(request, unicode(course.id))
    self.assertEqual(response.status_code, expected_response_code)
    return json.loads(response.content)
