'Check that pre existed entrance exam content should be overwrite with the imported course.'

def test_import_delete_pre_exiting_entrance_exam(self):

    exam_url = '/course/{}/entrance_exam/'.format(unicode(self.course.id))
    resp = self.client.post(exam_url, {'entrance_exam_minimum_score_pct': 0.5}, http_accept='application/json')
    self.assertEqual(resp.status_code, 201)
    self.course = modulestore().get_course(self.course.id)
    metadata = CourseMetadata.fetch_all(self.course)
    self.assertTrue(metadata['entrance_exam_enabled'])
    self.assertIsNotNone(metadata['entrance_exam_minimum_score_pct'])
    self.assertEqual(metadata['entrance_exam_minimum_score_pct']['value'], 0.5)
    self.assertTrue(len(milestones_helpers.get_course_milestones(unicode(self.course.id))))
    content_milestones = milestones_helpers.get_course_content_milestones(unicode(self.course.id), metadata['entrance_exam_id']['value'], milestones_helpers.get_milestone_relationship_types()['FULFILLS'])
    self.assertTrue(len(content_milestones))
    with open(self.entrance_exam_tar) as gtar:
        args = {'name': self.entrance_exam_tar, 'course-data': [gtar]}
        resp = self.client.post(self.url, args)
    self.assertEquals(resp.status_code, 200)
    course = self.store.get_course(self.course.id)
    self.assertIsNotNone(course)
    self.assertEquals(course.entrance_exam_enabled, True)
    self.assertEquals(course.entrance_exam_minimum_score_pct, 0.7)
