ProgrammingError: (1146, “Table 'test_.' doesn't exist”) when running unit test for Django
前端 未结 3 1192
后悔当初
后悔当初 2021-02-20 13:34

I\'m running a unit test using the Django framework and get this error.

Running the actual code does not have this problem, running the unit tests creates a test databas

3条回答
  •  野的像风
    2021-02-20 13:57

    To rectify this problem generate all your table which were declared in the settings.py file in your project folder.

    You can find the in the INSTALLED APPS Block in the settings file. For that run this command:

    manage.py syncdb or python manage.py syncdb

    If this doesn't work then set the Environment variable PATH for the python directory.

提交回复
热议问题