How to spread django unit tests over multiple files?

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

    Just make your directory structure like this:

    myapp/
        __init__.py
        tests/
            __init__.py
            test_one.py
            test_two.py
            ...
        ...
    

    And python manage.py test myapp will work as expected.

提交回复
热议问题