'Test creating and fetching the graders via ajax calls.'

def test_get_set_grader_types_ajax(self):

    grader_type_url_base = get_url(self.course.id, 'grading_handler')
    whole_model = self._model_from_url(grader_type_url_base)
    self.assertIn('graders', whole_model)
    self.assertIn('grade_cutoffs', whole_model)
    self.assertIn('grace_period', whole_model)
    whole_model['grace_period'] = {'hours': 1, 'minutes': 30, 'seconds': 0}
    response = self.client.ajax_post(grader_type_url_base, whole_model)
    self.assertEqual(200, response.status_code)
    whole_model = self._model_from_url(grader_type_url_base)
    self.assertEqual(whole_model['grace_period'], {'hours': 1, 'minutes': 30, 'seconds': 0})
    self.assertGreater(len(whole_model['graders']), 1)
    grader_sample = self._model_from_url((grader_type_url_base + '/1'))
    self.assertEqual(grader_sample, whole_model['graders'][1])
