'This tests both of the entrance exam settings and the `any_unfulfilled_milestones` helper.
Splitting the test requires significant refactoring `settings_handler()` view.'

@unittest.skipUnless(settings.FEATURES.get('ENTRANCE_EXAMS', False), True)
def test_entrance_exam_created_updated_and_deleted_successfully(self):

    self.assertFalse(milestones_helpers.any_unfulfilled_milestones(self.course.id, self.user.id), msg='The    initial    empty    state    should    be:    no    entrance    exam')
    settings_details_url = get_url(self.course.id)
    data = {'entrance_exam_enabled': 'true', 'entrance_exam_minimum_score_pct': '60', 'syllabus': 'none', 'short_description': 'empty', 'overview': '', 'effort': '', 'intro_video': ''}
    response = self.client.post(settings_details_url, data=json.dumps(data), content_type='application/json', HTTP_ACCEPT='application/json')
    self.assertEquals(response.status_code, 200)
    course = modulestore().get_course(self.course.id)
    self.assertTrue(course.entrance_exam_enabled)
    self.assertEquals(course.entrance_exam_minimum_score_pct, 0.6)
    data['entrance_exam_enabled'] = 'true'
    data['entrance_exam_minimum_score_pct'] = '80'
    response = self.client.post(settings_details_url, data=json.dumps(data), content_type='application/json', HTTP_ACCEPT='application/json')
    self.assertEquals(response.status_code, 200)
    course = modulestore().get_course(self.course.id)
    self.assertTrue(course.entrance_exam_enabled)
    self.assertEquals(course.entrance_exam_minimum_score_pct, 0.8)
    self.assertTrue(milestones_helpers.any_unfulfilled_milestones(self.course.id, self.user.id), msg='The    entrance    exam    should    be    required.')
    data['entrance_exam_enabled'] = 'false'
    response = self.client.post(settings_details_url, data=json.dumps(data), content_type='application/json', HTTP_ACCEPT='application/json')
    course = modulestore().get_course(self.course.id)
    self.assertEquals(response.status_code, 200)
    self.assertFalse(course.entrance_exam_enabled)
    self.assertEquals(course.entrance_exam_minimum_score_pct, None)
    self.assertFalse(milestones_helpers.any_unfulfilled_milestones(self.course.id, self.user.id), msg='The    entrance    exam    should    not    be    required    anymore')
