The Django documentation on tests states:
For a given Django application, the test runner looks for doctests in two places:
The
models.py
file. You can define module-level doctests and/or a doctest for individual models. It's common practice to put application-level doctests in the module docstring and model-level doctests in the model docstrings.A file called
tests.py
in the application directory -- i.e., the directory that holds models.py. This file is a hook for any and all doctests you want to write that aren't necessarily related to models.
Out of curiosity I'd like to know why Django's testrunner is limited to the doctests in models.py
, but more practically I'd like to know how one could expand the testrunner's doctests to include (for example) views.py
and other modules when running manage.py test
.
I'd be grateful for any input.
Thank you.
Brian