summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2013-05-10 23:08:45 -0400
committerCarl Meyer <carl@oddbird.net>2013-05-10 23:08:45 -0400
commit9012833af857e081b515ce760685b157638efcef (patch)
tree467982b071026047cab406e4eaae9cb1a2d2f77d /docs/ref
parentc0d8932a6d03e9326a4e407e944b09bf43cf929c (diff)
Fixed #17365, #17366, #18727 -- Switched to discovery test runner.
Thanks to Preston Timmons for the bulk of the work on the patch, especially updating Django's own test suite to comply with the requirements of the new runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on the patch and the discovery runner. Refs #11077, #17032, and #18670.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/testing.txt57
-rw-r--r--docs/ref/settings.txt7
2 files changed, 15 insertions, 49 deletions
diff --git a/docs/ref/contrib/gis/testing.txt b/docs/ref/contrib/gis/testing.txt
index 2a6dcef46f..fca6675345 100644
--- a/docs/ref/contrib/gis/testing.txt
+++ b/docs/ref/contrib/gis/testing.txt
@@ -134,57 +134,14 @@ your settings::
GeoDjango tests
===============
-GeoDjango's test suite may be run in one of two ways, either by itself or
-with the rest of :ref:`Django's unit tests <running-unit-tests>`.
+To have the GeoDjango tests executed when :ref:`running the Django test suite
+<running-unit-tests>` with ``runtests.py`` all of the databases in the settings
+file must be using one of the :ref:`spatial database backends
+<spatial-backends>`.
-Run only GeoDjango tests
-------------------------
-
-.. class:: django.contrib.gis.tests.GeoDjangoTestSuiteRunner
-
-To run *only* the tests for GeoDjango, the :setting:`TEST_RUNNER`
-setting must be changed to use the
-:class:`~django.contrib.gis.tests.GeoDjangoTestSuiteRunner`::
-
- TEST_RUNNER = 'django.contrib.gis.tests.GeoDjangoTestSuiteRunner'
Example
-^^^^^^^
-
-First, you'll need a bare-bones settings file, like below, that is
-customized with your spatial database name and user::
-
- TEST_RUNNER = 'django.contrib.gis.tests.GeoDjangoTestSuiteRunner'
-
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.contrib.gis.db.backends.postgis',
- 'NAME': 'a_spatial_database',
- 'USER': 'db_user'
- }
- }
-
-Assuming the above is in a file called ``postgis.py`` that is in the
-the same directory as ``manage.py`` of your Django project, then
-you may run the tests with the following command::
-
- $ python manage.py test --settings=postgis
-
-Run with ``runtests.py``
-------------------------
-
-To have the GeoDjango tests executed when
-:ref:`running the Django test suite <running-unit-tests>` with ``runtests.py``
-all of the databases in the settings file must be using one of the
-:ref:`spatial database backends <spatial-backends>`.
-
-.. warning::
-
- Do not change the :setting:`TEST_RUNNER` setting
- when running the GeoDjango tests with ``runtests.py``.
-
-Example
-^^^^^^^
+-------
The following is an example bare-bones settings file with spatial backends
that can be used to run the entire Django test suite, including those
@@ -208,3 +165,7 @@ directory as ``runtests.py``, then all Django and GeoDjango tests would
be performed when executing the command::
$ ./runtests.py --settings=postgis
+
+To run only the GeoDjango test suite, specify ``django.contrib.gis``::
+
+ $ ./runtests.py --settings=postgis django.contrib.gis
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 04b42aeeb2..eb470cdd14 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1725,11 +1725,16 @@ misspelled) variables. See :ref:`invalid-template-variables`..
TEST_RUNNER
-----------
-Default: ``'django.test.simple.DjangoTestSuiteRunner'``
+Default: ``'django.test.runner.DiscoverRunner'``
The name of the class to use for starting the test suite. See
:ref:`other-testing-frameworks`.
+.. versionchanged:: 1.6
+
+ Previously the default ``TEST_RUNNER`` was
+ ``django.test.simple.DjangoTestSuiteRunner``.
+
.. setting:: THOUSAND_SEPARATOR
THOUSAND_SEPARATOR