AttributeError: 'module' object has no attribute 'tests'

后端 未结 11 1826
自闭症患者
自闭症患者 2020-12-04 14:43

I\'m running this command:

python manage.py test project.apps.app1.tests

and it causes this error:

AttributeError: \

11条回答
  •  庸人自扰
    2020-12-04 15:28

    I had the same error as Chris. I had deleted an old model, then run tests.py, but another file (views.py) was still trying to import the deleted model.

    When I took out the now-obsolete import statement, problem solved.

提交回复
热议问题