Refactor model tests to reduce duplicated code.

Most of the tests for custom user models were just copied and pasted from
standard user models, with minor changes. Now all tests are shared between
both. There shouldn't be any important difference in what's actually tested.