Why is integration of Django testing with other tools even an issue? Consider the case of wanting to use the nose
test framework. It provides its own command, nosetests
, to find and run tests in a project tree. However, attempting to run nosetests
, instead of manage.py test
, in a Django project tree quickly reveals a problem:
kmt@lbox:/dj_projects/marketr$ nosetests E ====================================================================== ERROR: Failure: ImportError (Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/loader.py", line 379, in loadTestsFromName addr.filename, addr.module) File "/usr/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/importer.py", line 39, in importFromPath return self.importFromDir(dir_path, fqname...