'Simulate a failure in resetting attempts on a problem'

def test_reset_failure(self):

    problem_url_name = 'H1P1'
    location = InstructorTaskModuleTestCase.problem_location(problem_url_name)
    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('courseware.models.StudentModule.save') as mock_save:
        mock_save.side_effect = ZeroDivisionError(expected_message)
        instructor_task = self.reset_problem_attempts('instructor', location)
    self._assert_task_failure(instructor_task.id, 'reset_problem_attempts', problem_url_name, expected_message)
