How to spread django unit tests over multiple files?

后端 未结 10 1907
后悔当初
后悔当初 2020-12-07 11:46
  • I have a python-django application
  • I\'m using the unit testing framework
  • The tests are arranged in the file \"tests.py\" in the module directory
10条回答
  •  醉梦人生
    2020-12-07 12:37

    I have two files. One is tests.py and another is test_api.py. I can run these individually as below.

       manage.py test companies.tests
       manage.py test companies.test_api
    

    Refer @osa's response about file naming convention.

提交回复
热议问题