Testing only project in Django Testing only project in Django django django

Testing only project in Django


I would recommend using django-discover-runner. It allows you to specify and full dotted path to test.

If you just run ./manage.py test, it'll discover and run all tests underneath the TEST_DISCOVER_ROOT setting (a file system path). If you run ./manage.py test full.dotted.path.to.test_module, it'll run the tests in that module (you can also pass multiple modules). If you give it a single dotted path to a package (like a Django app) like ./manage.py test myapp and that package does not itself directly contain any tests, it'll do test discovery in all submodules of that package.


Create a new directory called apps, move your entire application into it minus the settings.py, manage.py, urls.py and whatever else is added by default by django-admin.py startproject and then run

./manage.py test apps

In the future, avoid keeping your entire application in one directory. Separate it into sub-apps based on functionality, for this very reason