【发布时间】:2013-08-26 22:59:21
【问题描述】:
我遇到了一个问题,我认为这是 Django South、SQLite 和测试的问题。在将 South 引入应用程序之前,我的测试一直有效。我曾经使用内存中的 SQLite,一切正常。现在有了 South,我收到一条错误消息,说我的一个 DB 表已经存在并且它失败了。
这是错误:
> python manage.py test protocols --settings=bionetbook.settings.test
Creating test database for alias 'default'...
/Projects/project/app/venv/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2013-08-09 00:00:00) while time zone support is active.
RuntimeWarning)
FATAL ERROR - The following SQL query failed: CREATE TABLE "stuff_stuff" ("id" integer NOT NULL PRIMARY KEY, "created" datetime NOT NULL, "modified" datetime NOT NULL, "user_id" integer NOT NULL, "start" datetime NOT NULL, "name" varchar(255) NOT NULL, "data" text NULL, "slug" varchar(255) NULL);
The error was: table "stuff_stuff" already exists
! 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: = DROP TABLE "stuff_stuff"; []
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: stuff:0003_initial
我是否在转动轮子试图让这三者协同工作? South 不喜欢测试工具和 SQLite 吗?
【问题讨论】:
标签: django django-south django-testing django-tests