'Make sure that cohorts.set_assignment_type() and cohorts.get_assignment_type() works correctly.'

def test_assignment_type(self):

    course = modulestore().get_course(self.toy_course_key)
    cohort1 = self._create_cohort(course.id, 'TestCohort1', CourseCohort.RANDOM)
    self._create_cohort(course.id, 'TestCohort2', CourseCohort.RANDOM)
    cohort3 = self._create_cohort(course.id, 'TestCohort3', CourseCohort.MANUAL)
    self.assertEqual(cohorts.get_assignment_type(cohort1), CourseCohort.RANDOM)
    cohorts.set_assignment_type(cohort1, CourseCohort.MANUAL)
    self.assertEqual(cohorts.get_assignment_type(cohort1), CourseCohort.MANUAL)
    cohorts.set_assignment_type(cohort3, CourseCohort.RANDOM)
    self.assertEqual(cohorts.get_assignment_type(cohort3), CourseCohort.RANDOM)
