Opened 3 years ago

Closed 3 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

Description

Assuming AUTH_USER_MODEL is set, running this test fails:

$python manage.py 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/handlers.py", line 14, in setUp
    user1 = User.objects.create_user('test', 'test@example.com', 'test')
AttributeError: type object 'User' has no attribute 'objects'

Attachments (1)

customuser.diff (1.1 KB) - added by ivan_virabyan 3 years ago.
skip tests when custom user is used

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by ivan_virabyan

skip tests when custom user is used

comment:1 Changed 3 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 3 years ago by ptone

  • Resolution set to duplicate
  • Status changed from new to closed

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