Code

#19495 closed Bug (invalid)

Tests of auth app are breaking if my AUTH_USER_MODEL is 'auth.CustomUser'

Reported by: germanofronza Owned by: nobody
Component: contrib.auth Version: 1.5-beta-1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have an auth app of my own and my custom user model is also called 'auth.CustomUser'. There's a conflict with the fixture 'contrib/auth/fixtures/custom_user.json'.

The test command line is:
$ ./manage.py test auth
Creating test database for alias 'default'...
....sssssssssssssssssssssssssssssssssE....sssssss.sssssssssssssssssssss.ssssssssssssssssssssssssssssssss...s.ssssssssssssssssssssssss..s............ssssssssssssssssssssss
======================================================================
ERROR: test_confirm_valid_custom_user (django.contrib.auth.tests.views.CustomUserPasswordResetTest)


Traceback (most recent call last):

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 256, in call

self._pre_setup()

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/test/utils.py", line 201, in _pre_setup

original_pre_setup(innerself)

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/test/utils.py", line 201, in _pre_setup

original_pre_setup(innerself)

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 450, in _pre_setup

self._fixture_setup()

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 822, in _fixture_setup

'skip_validation': True,

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 161, in call_command

return klass.execute(*args, defaults)

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 252, in execute

output = self.handle(*args, options)

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 187, in handle

for obj in objects:

File "/home/vagrant/venv/local/lib/python2.7/site-packages/django/core/serializers/json.py", line 75, in Deserializer

raise DeserializationError(e)

DeserializationError: Problem installing fixture '/home/vagrant/venv/local/lib/python2.7/site-packages/django/contrib/auth/fixtures/custom_user.json': CustomUser has no field named u'date_of_birth'

Attachments (0)

Change History (1)

comment:1 Changed 16 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

App names (specifically, the last element of the dotted path) must be unique. If you're using 'django.contrib.auth', you can't name your app 'whatever.auth'.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.