google-code-export / django-treemenus

Automatically exported from code.google.com/p/django-treemenus
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Problems flushing the test database on PostgreSQL 8.3 #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Run "./manage.py test" on Django installation with PostgreSQL 8.3 and 
django-treemenus.

What is the expected output? What do you see instead?

I would expect that tests run successfully. I get a log of errors like:

Error: Database test_myapp 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: relation "fake_menu_extension_fakemenuitemextension_id_seq" 
does not exist

Reason is probably that django-treemenus runs while testing "flush" first and 
on PostgreSQL Django (based on non-test database) runs (and after that "syncdb":

BEGIN;
TRUNCATE ..., "treemenus_menu", "treemenus_menuitem", ...;
SELECT setval('"treemenus_menuitem_id_seq"', 1, false);
SELECT setval('"treemenus_menu_id_seq"', 1, false);
COMMIT;

And setval probably fails as there are no tables yet?

What version of the product are you using? On what operating system?

Django 1.2.1, django-treemenus r65, Linux Debian 5.0.5.

Original issue reported on code.google.com by mmi...@gmail.com on 19 Jul 2010 at 10:08

GoogleCodeExporter commented 9 years ago
Yes the tests are currently failing on Postgres. I know an ugly workaround and 
will try to commit it.

Original comment by jpha...@gmail.com on 9 Oct 2010 at 2:06