'If the VerifiedTrackCohortedCourse feature is enabled for a course and the course is cohorted,
but the course does not have a verified cohort, an error is logged and enrollment mode changes do not
move learners into a cohort.'

@mock.patch('openedx.core.djangoapps.verified_track_content.models.log.error')
def test_cohorting_enabled_missing_verified_cohort(self, error_logger):

    self._enable_cohorting()
    self._enable_verified_track_cohorting()
    self.assertTrue(VerifiedTrackCohortedCourse.is_verified_track_cohort_enabled(self.course.id))
    self._verify_no_automatic_cohorting()
    self.assertTrue(error_logger.called)
    error_message = "cohort    named    '%s'    does    not    exist"
    self.assertIn(error_message, error_logger.call_args[0][0])
