summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorUnai Zalakain <unai@gisa-elkartea.org>2013-10-29 18:31:54 +0100
committerAnssi Kääriäinen <akaariai@gmail.com>2013-11-19 09:04:20 +0200
commit4fdd51b73240bf9c8d9472fcc45df699f0714755 (patch)
tree50e7cb8ea392bce529da22eb84a22b95a4220382 /docs
parent9348fc5628ccbbe156e9523b5eb8ba3ce783166e (diff)
Fixed #15179 -- middlewares not applied for test client login()
Requests made with django.test.Client.login() and logout() respect defaults defined in django.test.Client instantiation and are processed through middleware. Thanks to Loic for the reviews.
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.7.txt5
-rw-r--r--docs/topics/testing/overview.txt14
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index 8428c1853a..749a843a5a 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -496,6 +496,11 @@ Tests
:class:`~django.test.Client`. If ``True``, the request will be made
through HTTPS.
+* Requests made with :meth:`Client.login() <django.test.Client.login>` and
+ :meth:`Client.logout() <django.test.Client.logout>` respect defaults defined
+ in :class:`~django.test.Client` instantiation and are processed through
+ middleware.
+
Backwards incompatible changes in 1.7
=====================================
diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt
index 133931559e..c221702005 100644
--- a/docs/topics/testing/overview.txt
+++ b/docs/topics/testing/overview.txt
@@ -663,6 +663,13 @@ Use the ``django.test.Client`` class to make requests.
:meth:`~django.contrib.auth.models.UserManager.create_user` helper
method to create a new user with a correctly hashed password.
+ .. versionadded:: 1.7
+
+ Requests made with :meth:`~django.test.Client.login` go through the
+ request middleware. If you need to control the environment, you can
+ do so at :class:`~django.test.Client` instantiation or with the
+ `Client.defaults` attribute.
+
.. method:: Client.logout()
If your site uses Django's :doc:`authentication system</topics/auth/index>`,
@@ -673,6 +680,13 @@ Use the ``django.test.Client`` class to make requests.
and session data cleared to defaults. Subsequent requests will appear
to come from an :class:`~django.contrib.auth.models.AnonymousUser`.
+ .. versionadded:: 1.7
+
+ Requests made with :meth:`~django.test.Client.logout` go through the
+ request middleware. If you need to control the environment, you can
+ do so at :class:`~django.test.Client` instantiation or with the
+ `Client.defaults` attribute.
+
Testing responses
~~~~~~~~~~~~~~~~~