开发者

Django Testing - Problems with South and MySQL

开发者 https://www.devze.com 2023-02-02 09:17 出处:网络
Trying to setup our systems on our django project to utilize django\'s testing framework. However, when I try running python manage.py test I get various errors explained below.

Trying to setup our systems on our django project to utilize django's testing framework. However, when I try running python manage.py test I get various errors explained below.

We're working on a django environment where we use a reset.bat batch file to restart our development servers and load "clean" data from our fixtures. Apart from dealing with our local environment, the back file does the following:

Drops and Creates the MySQL Database "testsqldb"

    drop database testsqldb;
    create database testsqldb;

Syncs the database with the models (ignoring anything with South migrations)

    python manage.py syncdb --noinput

Runs the migrations

    python manage.py migrate --no-initial-data

Loads the fixtures

    python manage.py loaddata <fixture1> <fixture2> <fixture3> ...

W开发者_如何学运维hen I try to run python manage.py test with the InnoDB Engine set as default, I get:

 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had
 ! to leave it in an interim state between migrations.

 ! You *might* be able to recover with:

SQL commands to undo tables created are shown "here".

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS.
 ! NOTE: The error which caused the migration to fail is further up.

When I try running python manage.py test with MyISAM, I get errors regarding a table that we have faked on our system that is supposed to be created while the system is running.

Any thoughts or ideas regarding how to get the test running would be appreciated.


When I try running python manage.py test with MyISAM, I get errors regarding a table that we have faked on our system that is supposed to be created while the system is running.

If you have created a model for that, perhaps it would help, if you mark the Meta option as managed=False. Then django wouldn't involve to create it.

0

精彩评论

暂无评论...
验证码 换一张
取 消