'Check that the expected number of users are present in the user_count returned by the view handler'

def check_user_count(self, expected_count, cohort):

    cohort_listed = False
    for c in self.get_handler(self.course)['cohorts']:
        if (c['name'] == cohort.name):
            cohort_listed = True
            self.assertEqual(expected_count, c['user_count'])
    self.assertTrue(cohort_listed)
