My test not working. If I try python manage.py test appname I have this error:
! You *might* be able to recover with: = DROP TABLE "appname_userprofile"; []
= DROP TABLE "appname_table2"; []
= DROP TABLE "appname_table3"; []
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: content:0015_initial
django.db.utils.DatabaseError: table "appname_userprofile" already exists
How to run my python manage.py test appname with
manage.py migrate appname --fake
You’d have to write a custom test runner to selectively add
--faketo individual migrations, as far as I know.You should probably fix your database migrations — it looks like you have two migrations which are trying to create the same table.
South wants to run all of your migrations, in order, before starting the tests, in order to build up an initial database, and right now it can’t do that.
You can disable South completely for unit tests if you put this in your
settings.pyfile (reference):If you do that, then the Django test runner will just create your test database based on your current models, rather than running migrations to build it.