'Unit Test: test_contentstore_views_entrance_exam_delete'

def test_contentstore_views_entrance_exam_delete(self):

    resp = self.client.post(self.exam_url, {}, http_accept='application/json')
    self.assertEqual(resp.status_code, 201)
    resp = self.client.get(self.exam_url)
    self.assertEqual(resp.status_code, 200)
    resp = self.client.delete(self.exam_url)
    self.assertEqual(resp.status_code, 204)
    resp = self.client.get(self.exam_url)
    self.assertEqual(resp.status_code, 404)
    user = User.objects.create(username='test_user', email='test_user@edx.org', is_active=True)
    user.set_password('test')
    user.save()
    milestones = milestones_helpers.get_course_milestones(unicode(self.course_key))
    self.assertEqual(len(milestones), 1)
    milestone_key = '{}.{}'.format(milestones[0]['namespace'], milestones[0]['name'])
    paths = milestones_helpers.get_course_milestones_fulfillment_paths(unicode(self.course_key), milestones_helpers.serialize_user(user))
    self.assertEqual(len(paths[milestone_key]), 0)
    resp = self.client.post(self.exam_url, {}, http_accept='application/json')
    self.assertEqual(resp.status_code, 201)
    resp = self.client.get(self.exam_url)
    self.assertEqual(resp.status_code, 200)
    graders = CourseGradingModel.fetch(self.course_key).graders
    count = 0
    for grader in graders:
        if (grader['type'] == GRADER_TYPES['ENTRANCE_EXAM']):
            count += 1
    self.assertEqual(count, 1)
