#21164: get_user_model() does not handle custom user models for testing purposes
-----------------------------------+--------------------------------------
     Reporter:  raymond.penners@…  |                    Owner:  nobody
         Type:  Bug                |                   Status:  closed
    Component:  contrib.auth       |                  Version:  1.5
     Severity:  Normal             |               Resolution:  invalid
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by raymond.penners@…):

 Sorry for reopening once more, but I would like to file this as a
 documentation bug then.

 Please see the following lines taken from
 https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-
 users-and-testing-fixtures

 {{{
 [...]
 To ensure that your test suite will pass in any project configuration
 [...]
 tests may also be needed to be added to ensure that the application works
 with any user model
 [...]
 To assist with this, Django provides two substitute user models that can
 be used in test suites:
 [...]
 django.contrib.auth.tests.custom_user.CustomUser
 django.contrib.auth.tests.custom_user.ExtensionUser
 [...]
 You can then use the @override_settings decorator to make that test run
 with the custom User model.
 [...]
 @override_settings(AUTH_USER_MODEL='auth.CustomUser')
 }}}

 So, unless I am mistaken, the example project follows the documentation to
 the letter.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21164#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/084.bf8408841169561ca167d6bfa759556a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to