'Check that cohort config parsing works right.
Note: The cohort config on the CourseModule is no longer used.
See openedx.core.djangoapps.course_groups.models.CourseCohortSettings.'

def test_cohort_config(self):

    modulestore = XMLModuleStore(DATA_DIR, source_dirs=['toy'])
    toy_id = CourseKey.from_string('edX/toy/2012_Fall')
    course = modulestore.get_course(toy_id)
    self.assertFalse(course.is_cohorted)
    course.cohort_config = {}
    self.assertFalse(course.is_cohorted)
    course.cohort_config = {'cohorted': False}
    self.assertFalse(course.is_cohorted)
    course.cohort_config = {'cohorted': True}
    self.assertTrue(course.is_cohorted)
