- Create a directory in the app called
tests
- Create an
__init__.py
file in that directory with the contents of this gist - Create individual test files in the directory, e.g.
some_kind_of_test.py
,some_other_kind_of_test.py
- Run as normal, e.g.
./manage.py test myapp
or./manage.py test myapp.SomeSpecificTest
http://stackoverflow.com/questions/6248510/how-to-spread-django-unit-tests-over-multiple-files
For Django > 1.6 tests can be in a tests directory with an empty
__init__.py
file. They just need to be namedtest_<something>
.