djangoのテストフレームワークを利用するために、djangoプロジェクトでシステムをセットアップしようとしています。しかし、実行しようとすると、python manage.py test
以下に説明するさまざまなエラーが発生します。
私たちは、reset.batバッチファイルを使用して開発サーバーを再起動し、フィクスチャから「クリーンな」データをロードするdjango環境に取り組んでいます。ローカル環境を処理する以外に、バックファイルは次のことを行います。
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> ...
python manage.py test
InnoDBエンジンをデフォルトとして設定して実行しようとすると、次のようになります。
! 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コマンドは「ここ」に表示されます。
! 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.
MyISAMで実行しようとするpython manage.py test
と、システムの実行中に作成されるはずの、システム上で偽造されたテーブルに関するエラーが発生します。
テストを実行する方法に関する考えやアイデアをいただければ幸いです。