2
我想用django硒来测试我的django1.3应用程序。用于测试的数据库后端是sqlite3。(DatabaseError:没有这样的表:django_session)Django 1.3硒测试期间的错误
这是我的设置文件的一个片段。
if 'test' in sys.argv:
DB_ENGINE = 'django.db.backends.sqlite3'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': ':memory:',
'NAME': 'database_one',
},
'database_two': {
'ENGINE': 'django.db.backends.sqlite3', ]
'TEST_NAME': ':memory:',
'NAME': 'database_two',
},
'database_three': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': ':memory:',
'NAME': 'database_three',
},
}
SOUTH_TESTS_MIGRATE = False
当我运行Selenium测试,我得到的错误说
DatabaseError: no such table: django_session
ERROR
由于事实上它测试的创建过程中显示出来,该表在输出创建如下,
Creating test database for alias 'default' (':memory:')...
Creating tables ...
Creating table django_content_type
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_session
我真的被困在这里,因为我在其他地方找不到任何东西。
PS:提前运行测试..
感谢时Postgres的测试工作正常(我的实际PROD数据库引擎),但我想用sqlite3的对于Postgres需要花费大量的时间来建立&拆卸DB: )
谢谢,这工作:) –
@sandeepraju:很高兴有帮助。 –