Django 可重用包 - 测试数据库不是即时创建的

Django reusable package - test DB is not created on the fly

我正在为我的 django 可重用文件创建测试 package/application 而我的数据库不是动态创建的。

我正在执行 https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications

中的步骤

在定义了某个模型之前,它工作正常,当它在

上失败时
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "c:\github.com\django\django\db\backends\utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "c:\github.com\django\django\db\backends\sqlite3\base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)sqlite3.OperationalError: no such table: table_name

创建的文件夹中也没有sqlite3文件。

我错过了什么?

我发现了问题,它缺少迁移。

创建迁移后,使用模型进行测试 运行 就好了。