'Make sure cohorts.get_cohort() does the right thing.
If there are auto cohort groups then a user should be assigned one.'

def test_cohorting_with_auto_cohorts(self):

    course = modulestore().get_course(self.toy_course_key)
    self.assertFalse(cohorts.is_course_cohorted(course.id))
    user1 = UserFactory(username='test', email='a@b.com')
    user2 = UserFactory(username='test2', email='a2@b.com')
    cohort = CohortFactory(course_id=course.id, name='TestCohort', users=[user1])
    config_course_cohorts(course, is_cohorted=True, auto_cohorts=['AutoGroup'])
    self.assertEquals(cohorts.get_cohort(user1, course.id).id, cohort.id, 'user1    should    stay    put')
    self.assertEquals(cohorts.get_cohort(user2, course.id).name, 'AutoGroup', 'user2    should    be    auto-cohorted')
