mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #20177 - Corrected docs for django.test.utils.setup_test_environment.
Thanks vlad.london.uk@ for the report.
This commit is contained in:
@@ -326,6 +326,13 @@ in the shell::
|
||||
>>> from django.test.utils import setup_test_environment
|
||||
>>> setup_test_environment()
|
||||
|
||||
:meth:`~django.test.utils.setup_test_environment` installs a template renderer
|
||||
which will allow us to examine some additional attributes on responses such as
|
||||
``response.context`` that otherwise wouldn't be available. Note that this
|
||||
method *does not* setup a test database, so the following will be run against
|
||||
the existing database and the output may differ slightly depending on what
|
||||
polls you already created.
|
||||
|
||||
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)::
|
||||
|
||||
Reference in New Issue
Block a user