'Confirm that expected values are stored in InstructorTask on task failure.'

def _assert_task_failure(self, entry_id, task_type, problem_url_name, expected_message):

    instructor_task = InstructorTask.objects.get(id=entry_id)
    self.assertEqual(instructor_task.task_state, FAILURE)
    self.assertEqual(instructor_task.requester.username, 'instructor')
    self.assertEqual(instructor_task.task_type, task_type)
    task_input = json.loads(instructor_task.task_input)
    self.assertNotIn('student', task_input)
    self.assertEqual(task_input['problem_url'], InstructorTaskModuleTestCase.problem_location(problem_url_name).to_deprecated_string())
    status = json.loads(instructor_task.task_output)
    self.assertEqual(status['exception'], 'ZeroDivisionError')
    self.assertEqual(status['message'], expected_message)
    status = InstructorTaskModuleTestCase.get_task_status(instructor_task.task_id)
    self.assertEqual(status['message'], expected_message)
