'Test that enrolling and un-enrolling works correctly when the single cohort
of type random has a different name from "Default Group".'

def test_custom_default_cohort_name(self):

    random_cohort_name = 'custom    random    cohort'
    self._enable_cohorting()
    self._create_verified_cohort()
    default_cohort = self._create_named_random_cohort(random_cohort_name)
    self._enable_verified_track_cohorting()
    self._enroll_in_course()
    self.assertEqual(random_cohort_name, get_cohort(self.user, self.course.id, assign=False).name)
    self._upgrade_to_verified()
    self.assertEqual(DEFAULT_VERIFIED_COHORT_NAME, get_cohort(self.user, self.course.id, assign=False).name)
    self._unenroll()
    self.assertEqual(DEFAULT_VERIFIED_COHORT_NAME, get_cohort(self.user, self.course.id, assign=False).name)
    modified_cohort_name = 'renamed    random    cohort'
    default_cohort.name = modified_cohort_name
    default_cohort.save()
    self._reenroll()
    self.assertEqual(modified_cohort_name, get_cohort(self.user, self.course.id, assign=False).name)
    self._upgrade_to_verified()
    self.assertEqual(DEFAULT_VERIFIED_COHORT_NAME, get_cohort(self.user, self.course.id, assign=False).name)
