Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django 2.1的完整性错误_Python_Django_Python 3.x_Python Unittest - Fatal编程技术网

Python Django 2.1的完整性错误

Python Django 2.1的完整性错误,python,django,python-3.x,python-unittest,Python,Django,Python 3.x,Python Unittest,我尝试将我的一个项目更新为Django 2.1 它与Django 2.0.7完美配合,在更新到Django 2.1后,我在尝试启动单元测试时出现以下错误: python manage.py test Creating test database for alias 'default'... Destroying old test database for alias 'default'... Traceback (most recent call last): File "c:\gitp

我尝试将我的一个项目更新为Django 2.1

它与Django 2.0.7完美配合,在更新到Django 2.1后,我在尝试启动单元测试时出现以下错误:

python manage.py test

Creating test database for alias 'default'...
Destroying old test database for alias 'default'...

Traceback (most recent call last):
  File "c:\gitpro~1\feedcr~1.io\venv\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "c:\gitpro~1\feedcr~1.io\venv\lib\site-packages\django\db\backends\sqlite3\base.py", line 296, in execute
    return Database.Cursor.execute(self, query, params)

sqlite3.IntegrityError: UNIQUE constraint failed: auth_permission.content_type_id, auth_permission.codename
任何关于什么可能是原因的想法,我试图看看变更日志,但它并没有真正的帮助


更改日志:

错误是由应用程序引起的:
django管理员查看权限
,django 2.1不再需要该权限


相关Github问题:

您创建并应用迁移了吗?当然,但这不应该是问题,django创建了一个新的sqlite数据库进行测试,并自动应用迁移。正如我所说,同样的过程会导致Django 2.1出现错误