I don't really agree with the approach taken in this test, it feels like a big overuse of mock objects. I think it's important to note that test code is just as important as production code, and we should take care to make sure that both remain clear and maintainable. I think even that fact that this is called a "complex" example should tell us that something is not right.

The question here is why are we using mock objects at all here? The two answers to me seem to be:

* To isolate parts of the code, so that we can test only the specific areas that we want to with each test.
* So that we don't have to keep hitting the database unnecessarily and keep our tests running quickly.

Both of these are good things to aim for, but the trade-off is:

* The tests are harder to understand.
* The tests will probably be harder to maintain.
* The tests provide less assurance that everything is working correctly.

(of course much of this is discussed elsewhere, see for example [Google's testing blog](http://googletesting.blogspot.de/2013/05/testing-on-toilet-dont-overuse-mocks.html) or [also here](http://svengrand.blogspot.de/2012/02/mocking-best-practices.html)).

Coming back to this specific test, I don't think that there is really any reason to mock the validation stage. There won't be much of a speed difference (you could also pass a different schema through in the context if really necessary), and I don't think that it's worth the extra testing code.

I don't like that we need to patch so many other objects just to be able to mock the database object here either. It doesn't seem immediately clear from reading the test code why so many objects have to be patched (such as `_get_action` in particular), and you end up having to read through the `user_update` function to understand why. I know that this is necessary due to the way that `user_update` works currently, but I think we should consider either:

* Accepting that it might be just too awkward to mock some functions.
* Refactoring functions that are too difficult to test.

I'm not sure how this could be documented in the testing guidelines however.