Test problems after upgrading to 1.8

55 visualitzacions
Ves al primer missatge no llegit

o_r

no llegida,
28 d’oct. 2015, 4:19:2528/10/15
a Django users
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!

Tim Graham

no llegida,
28 d’oct. 2015, 9:06:2428/10/15
a Django users
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.

o_r

no llegida,
28 d’oct. 2015, 9:32:3328/10/15
a Django users
I removed the table auth_message from my database, I tried to run it once more, and then I got a new similar message, so I removed that table too, and now it works again. I still don't understand why I suddenly got this error, but it's working again, so I'm happy :)
Respon a tots
Respon a l'autor
Reenvia
0 missatges nous