[TIP] Running tests of externally-maintained apps when testing Django projects
lists at alexdutton.co.uk
Mon May 7 13:04:11 PDT 2012
Best practice question. I maintain a Django-based site that comprises
various externally-maintained apps and some apps that are site-specific.
Is it worth running the tests of these externally-maintained apps when
testing the site as a whole? Should I be viewing these as solely unit
tests, or as integration tests?
Most of the externally-maintained apps (e.g. object_permissions) come
with their own settings files and are invoked like:
$ django-admin test --settings=object_permissions.tests.settings
These settings often declare a specific ROOT_URLCONF and other settings
(e.g. TESTING = True). Just including the app in INSTALLED_APPS is
liable to result in test failures. I imagine I'd have to patch
ROOT_URLCONF for each app, which means a custom test runner and general
ugliness. It also doesn't suffice for integration testing, and it's
arguable that someone else would be keeping an eye on the unit tests, so
there's no need for me to run them.
More information about the testing-in-python