How to spread django unit tests over multiple files?

后端 未结 10 1959
后悔当初
后悔当初 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:18

    If you have a more complicated setup, or don't want to use from ... import *-type statements, you can define a function called suite in your tests.py (or tests/__init__.py), which returns an instance of unittest.TestSuite.

提交回复
热议问题