'Call `users_in_cohort` for a given cohort/requested page, and return
its response as a dict.  When `should_return_bad_request` is True,
verify that the response indicates a bad request.'

def request_users_in_cohort(self, cohort, course, requested_page, should_return_bad_request=False):

    request = RequestFactory().get('dummy_url', {'page': requested_page})
    request.user = self.staff_user
    response = users_in_cohort(request, unicode(course.id), cohort.id)
    if should_return_bad_request:
        self.assertEqual(response.status_code, 400)
        return
    self.assertEqual(response.status_code, 200)
    return json.loads(response.content)
