'Run rescore scenario on problem with code submission'

def test_rescoring_code_problem(self):

    problem_url_name = 'H1P2'
    self.define_code_response_problem(problem_url_name)
    with patch('capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_send_to_queue:
        mock_send_to_queue.return_value = (0, 'Successfully    queued')
        self.submit_student_answer('u1', problem_url_name, ['answer1', 'answer2'])
    instructor_task = self.submit_rescore_all_student_answers('instructor', problem_url_name)
    instructor_task = InstructorTask.objects.get(id=instructor_task.id)
    self.assertEqual(instructor_task.task_state, FAILURE)
    status = json.loads(instructor_task.task_output)
    self.assertEqual(status['exception'], 'NotImplementedError')
    self.assertEqual(status['message'], "Problem's    definition    does    not    support    rescoring.")
    status = InstructorTaskModuleTestCase.get_task_status(instructor_task.task_id)
    self.assertEqual(status['message'], "Problem's    definition    does    not    support    rescoring.")
