If I run the following command:
>python manage.py test
Django looks at tests.py in my application, and runs any doctests or unit tests in th
I solved this for myself a while ago:
apps = settings.INSTALLED_APPS for app in apps: try: a = app + '.test' __import__(a) m = sys.modules[a] except ImportError: #no test jobs for this module, continue to next one continue #run your test using the imported module m
This allowed me to put per-module tests in their own test.py file, so they didn't get mixed up with the rest of my application code. It would be easy to modify this to just look for doc tests in each of your modules and run them if it found them.