How to test single application (not project) in Django?

django, testing

Solution

It is possible to run a single app's tests standalone, without creating a Django test project for that purpose. One way of doing so is by creating a `runtests.py` in your app's root dir which setups Django settings and runs `./manage.py test your_app` programmatically. One example of `runtests.py` is Django's own: runtests.py (documentation).

Django's own `runtests.py` is a good reference but I find it convoluted for most cases. Below are a couple of alternative examples:

- Django-Modeltranslation

- My own minimalistic one

Problem

I would like to test my small application, that I keep in a separate package. Right now I created a "test_project" directory, created a test project there and I am using the project's manage.py to run tests. But I keep wondering - is there a better method? Is it possible to launch a single app's tests, perhaps with some default configuration (like, sqlite database)?

Original source