Opened 4 years ago

Closed 4 years ago

#19050 closed Bug (duplicate)

auth.ModWsgiHandlerTestCase fails when User model is swapped

Reported by: Ivan Virabyan Owned by: nobody
Component: contrib.auth Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Assuming AUTH_USER_MODEL is set, running this test fails:

$python test auth.ModWsgiHandlerTestCase.test_check_password

ERROR: test_check_password (django.contrib.auth.tests.handlers.ModWsgiHandlerTestCase)
Traceback (most recent call last):
  File "/Users/ivan/Projects/django/django/contrib/auth/tests/", line 14, in setUp
    user1 = User.objects.create_user('test', '', 'test')
AttributeError: type object 'User' has no attribute 'objects'

Attachments (1)

customuser.diff (1.1 KB) - added by Ivan Virabyan 4 years ago.
skip tests when custom user is used

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by Ivan Virabyan

Attachment: customuser.diff added

skip tests when custom user is used

comment:1 Changed 4 years ago by Claude Paroz

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 4 years ago by Preston Holmes

Resolution: duplicate
Status: newclosed

While this preceded it, #19057 is a duplicate that has greater discussion on this issue

Note: See TracTickets for help on using tickets.
Back to Top