minor: use `dedent` with `test_custom_user_model`

Also: sort imports, PEP8 fixes.

/cc @Stranger6667: just to make you aware of `dedent`.
@pelme 
Makes sense for `extra_settings`.
But we do not want to overwrite / wrap `makepyfile`, do we?