I'm using the mock library and I want to be able to mock the save() function of my model class in the following way:
Twice the original function should be invoked (and succeed in actually saving the model), and the third time it should throw an exception.
This is for a unit test of a function that calls save three times (and this particular test needs to handle a case in which only the third call fails).