'Simulate a failure in rescoring a problem'

def test_rescoring_failure(self):

    problem_url_name = 'H1P1'
    self.define_option_problem(problem_url_name)
    self.submit_student_answer('u1', problem_url_name, [OPTION_1, OPTION_1])
    expected_message = 'bad    things    happened'
    with patch('capa.capa_problem.LoncapaProblem.get_grade_from_current_answers') as mock_rescore:
        mock_rescore.side_effect = ZeroDivisionError(expected_message)
        instructor_task = self.submit_rescore_all_student_answers('instructor', problem_url_name)
    self._assert_task_failure(instructor_task.id, 'rescore_problem', problem_url_name, expected_message)
