Robert Martin
Robert Martin

Reputation: 17177

Can django testing with databases be fixed for MySQL?

I have a large django project (AskBot) that I am running the tests for. When I configure DATABASES to use sqlite, the tests pass. When I figure to use PostgreSQL, the tests pass, but when I configure to use MySQL, some of the tests fail. By inspecting the test database that is created during testing, I can see that the schema during the tests is missing some fields compared to the real schema. These fields seem to be present when I create the database using python manage.py syncdb and python manage.py migrate, but not present during the tests.

Is this a common behavior in django, or could someone experienced in django suggest a next step? Thanks.

Upvotes: 1

Views: 64

Answers (1)

alecxe
alecxe

Reputation: 474161

If you haven't explicitly set SOUTH_TESTS_MIGRATE setting to False - test database will be created via south migrations. Try to set it to False and see if you will have any difference in schemes between normal syncdb and during the test run.

Hope I guessed right.

See also:

Upvotes: 1

Related Questions