Wednesday, October 28, 2015

Re: Test problems after upgrading to 1.8

It seems a bit difficult to debug from what you provided so far. One idea: do you have migrations for all your apps?

If you could put together a minimal project that reproduces the problem that would be useful.

On Wednesday, October 28, 2015 at 4:19:25 AM UTC-4, o_r wrote:
I've recently upgraded from 1.3 to 1.8. I have a rather large testsuite, and by the end of the upgrade all the tests passed. Now I've added some new models, and made the new migration, and it seemed to work as expected, but when I try to run my tests again now, I get an error message like this:

CommandError: Database test_27_10 couldn't be flushed. Possible reasons:

  * The database isn't running or isn't configured correctly.

  * At least one of the expected database tables doesn't exist.

  * The SQL was invalid.

Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.

The full error: cannot truncate a table referenced in a foreign key constraint

DETAIL:  Table "auth_message" references "auth_user".

HINT:  Truncate table "auth_message" at the same time, or use TRUNCATE ... CASCADE.


I used to run south, so as part of the upgrade, I used the --fake option on everything, but later on I removed the migration for contenttypes and auth, and ran the migration again.

Any Ideas of what is wrong and how to fix it? Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e9b342e4-d570-488d-951f-1622827770f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment