Django 从填充的数据库设置测试?

Django Setting up a test from a populated database?

我已经 运行 我的大部分单元测试都是从我的模型的新实例进行的,但是我现在想在我填充的模型上进行测试,因为重新填充我的数据库并非易事。这可能吗?我正在努力寻找有关该主题的文档。当前使用代码:

def setUpTestData(cls):
    create test data for model 1
    create test data for model 2

def tests
    run some tests

这是关于在测试前加载初始数据(a.k.a.fixtures)的官方文档:https://docs.djangoproject.com/en/2.0/howto/initial-data/

另外,看看https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.TransactionTestCase.fixtures