Hi,

In which part of the test are you truncating the db?
It could also be that test_<project_name> db is still in your database
after a previous run of test, and it refuses to flush.
Try manually deleting it and running syncdb again.


--
Gladys
http://blog.bixly.com


On Apr 17, 1:20 am, Aleksandr Vladimirskiy <[email protected]>
wrote:
> Hello,
>
> I'm running a test but it fails after syncdb part with the following
> message:
>
> Error: Database test_<project_name> 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.py 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 "<table_name_1>" references "<table_name_2>".
> HINT:  Truncate table "<table_name_1>" at the same time, or use
> TRUNCATE ... CASCADE.
>
> The foreign key is between models in 2 different apps.
>
> Thanks,
>
> Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to