Opened 12 years ago
Closed 12 years ago
#20214 closed Uncategorized (needsinfo)
Custom User Model Manager has problem with test database
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Testing framework | Version: | 1.5 |
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'm using a custom user model with :
class BaseUser(AbstractUser) and AUTH_USER_MODEL = "main.BaseUser" .
But when I try to run the test cases I got this error :
(DEV)devniel@ubuntu:~/xxx$ python manage.py test main
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_xxx'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_quickytaxi', or 'no' to cancel: yes
Destroying old test database 'default'...
AttributeError: Manager isn't available; User has been swapped for 'main.BaseUser'
I try with a test.py empty and the problem still persists.
I can't reproduce this - I've got several test projects plus projects in production that are using custom user models, and they're not having the problem you describe.
Two things would be helpful here:
Closing needsinfo -- we haven't got enough information to reproduce this problem. Please reopen if you can provide the information I've described.