Commit 9d700322 authored by Kevin Christopher Henry's avatar Kevin Christopher Henry Committed by Tim Graham
Browse files

Fixed #19885 -- cleaned up the django.test namespace

* override_settings may now be imported from django.test
* removed Approximate from django.test
* updated documentation for things importable from django.test

Thanks akaariai for the suggestion.
parent a52cc1c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@ from django.test.testcases import (TestCase, TransactionTestCase,
    SimpleTestCase, LiveServerTestCase, skipIfDBFeature,
    skipUnlessDBFeature
)
from django.test.utils import Approximate
from django.test.utils import override_settings
+2 −2
Original line number Diff line number Diff line
@@ -117,9 +117,9 @@ these changes.
* The ``mod_python`` request handler will be removed. The ``mod_wsgi``
  handler should be used instead.

* The ``template`` attribute on :class:`~django.test.client.Response`
* The ``template`` attribute on :class:`~django.test.Response`
  objects returned by the :ref:`test client <test-client>` will be removed.
  The :attr:`~django.test.client.Response.templates` attribute should be
  The :attr:`~django.test.Response.templates` attribute should be
  used instead.

* The ``django.test.simple.DjangoTestRunner`` will be removed.
+2 −2
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ Before we try to fix anything, let's have a look at the tools at our disposal.
The Django test client
----------------------

Django provides a test :class:`~django.test.client.Client` to simulate a user
Django provides a test :class:`~django.test.Client` to simulate a user
interacting with the code at the view level.  We can use it in ``tests.py``
or even in the shell.

@@ -341,7 +341,7 @@ Next we need to import the test client class (later in ``tests.py`` we will use
the :class:`django.test.TestCase` class, which comes with its own client, so
this won't be required)::

    >>> from django.test.client import Client
    >>> from django.test import Client
    >>> # create an instance of the client for our use
    >>> client = Client()

+1 −1
Original line number Diff line number Diff line
@@ -565,7 +565,7 @@ setting_changed

This signal is sent when the value of a setting is changed through the
``django.test.TestCase.settings()`` context manager or the
:func:`django.test.utils.override_settings` decorator/context manager.
:func:`django.test.override_settings` decorator/context manager.

It's actually sent twice: when the new value is applied ("setup") and when the
original value is restored ("teardown"). Use the ``enter`` argument to
+1 −1
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ The generic relation classes -- ``GenericForeignKey`` and ``GenericRelation``
Testing
-------

:meth:`django.test.client.Client.login` has changed
:meth:`django.test.Client.login` has changed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Old (0.96)::
Loading