'Test that it is not possible to update the assignment type of a single random cohort.'

def test_cannot_update_assignment_type_of_single_random_cohort(self):

    cohort_name = 'I    AM    A    RANDOM    COHORT'
    data = {'name': cohort_name, 'assignment_type': CourseCohort.RANDOM}
    response_dict = self.put_handler(self.course, data=data)
    self.assertEqual(cohort_name, response_dict.get('name'))
    self.assertEqual(CourseCohort.RANDOM, response_dict.get('assignment_type'))
    cohort = get_cohort_by_name(self.course.id, cohort_name)
    data = {'name': cohort_name, 'assignment_type': CourseCohort.MANUAL}
    response_dict = self.put_handler(self.course, cohort, data=data, expected_response_code=400)
    self.assertEqual('There    must    be    one    cohort    to    which    students    can    automatically    be    assigned.', response_dict.get('error'))
