def create_fixture(self):
"""Create the fixture using the dumpdata command"""
excluded = [
'admin',
'auth.Permission',
'contenttypes',
'sessions',
'wagtailcore.grouppagepermission',
'wagtailcore.groupcollectionpermission',
]
path = os.path.join(settings.BASE_DIR, 'tests/fixtures/basic_site.json')
call_command(
'dumpdata',
exclude=excluded,
natural_foreign=True,
indent=2,
output=path
)
评论列表
文章目录