转储数据python manage.py dumpdata --format json --indent 4 --exclude auth.permission --exclude contenttypes > app/fixtures/app_test_data.json
运行 python manage.py test app,我得到以下错误:
IntegrityError: Problem installing fixtures: The row in table 'django_admin_log' with primary key '517' has an invalid foreign key: django_admin_log.content_type_id contains a value '28' that does not have a corresponding value in django_content_type.id.
有任何想法吗?使用 dumpdata/Django 的测试运行器时,我遇到了很多类似的问题。