Running the test framework
When you submit a patch, you should always attach tests. Here are the guidelines for running the test framwork to, ahem, test your tests.
Tests should be run with django/trunk/tests/runtests.py
See also TestingDjango (I wasn't aware it existed before I started this).
Settings
To run tests, settings need to be provided.
Here's one possible way to do it using sqlite:
$ cd tests $ ../django/bin/django-admin.py startproject test_settings $ sed -i "s/DATABASE_ENGINE = ''/DATABASE_ENGINE = 'sqlite3'/;s/DATABASE_NAME = ''/DATABASE_NAME = 'test.db'/" test_settings/settings.py $ python runtests.py --verbosity=2 --settings=test_settings.settings
Running only specific tests
This example runs only form tests.
$ python runtests.py --verbosity=2 --settings=test_settings.settings forms
Attachments
- settings_unittest.py (464 bytes) -
Minimal unittest settings file
, added by calvin@debian.org on 03/12/08 18:42:13. - Makefile (114 bytes) -
Unix Makefile to run unittests
, added by Bastian Kleineidam <calvin@debian.org> on 03/12/08 18:42:48.
