我正在尝试编写一些单元测试并使用它们运行它们,manage.py test但由于django_migrations某种原因脚本无法创建表。
这是完整的错误:
Creating test database for alias 'default'...
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\db\backends\utils.py", line 83, in _execute
return self.cursor.execute(sql)
psycopg2.ProgrammingError: no schema has been selected to create in
LINE 1: CREATE TABLE "django_migrations" ("id" serial NOT NULL PRIMA...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\db\migrations\recorder.py", line 55, in ensure_schema
editor.create_model(self.Migration)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\db\backends\base\schema.py", line 298, in …Run Code Online (Sandbox Code Playgroud)