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

后端 未结 11 1798
自闭症患者
自闭症患者 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:27

    According to django document When you run your tests, the default behavior of the test utility is to find all the test cases (that is, subclasses of unittest.TestCase) in any file whose name begins with test, automatically build a test suite out of those test cases, and run that suite.

    so try this : python manage.py test tests.py

提交回复
热议问题