Opened 11 years ago

Closed 11 years ago

#20214 closed Uncategorized (needsinfo)

Custom User Model Manager has problem with test database

Reported by: dnielfs@… 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.

Change History (1)

comment:1 by Russell Keith-Magee, 11 years ago

Resolution: needsinfo
Status: newclosed

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:

1) The output of ./manage.py test --traceback. This will give us the full error (and the stack trace)

2) A description of the minimum steps you need to follow to reproduce this problem. My first guess is that you've got some sort of signal handling going on here; but it's impossible to say without seeing code.

Closing needsinfo -- we haven't got enough information to reproduce this problem. Please reopen if you can provide the information I've described.

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