I have a reusable Django app and I'm importing it into another project. I want to be able to run the tests of that app which means I need my own settings.py file for just the tests.
What is the accepted way of running those tests? I've noticed some projects create a runtests.py
file that adjusts the Django settings and uses the Django test runner.
I've also noticed that internal company projects tell the developer to create a new settings file, app_tests_settings.py
and run the tests with manage.py:
./manage.py run tests --settings=app_tests_settings
Which way is best and are there other ways of running app-specific tests that use custom settings?
Update: the app needs a particular database backend because it uses PostGIS