summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRigel Di Scala <rigel.discala@propylon.com>2014-10-13 12:10:00 +0100
committerTim Graham <timograham@gmail.com>2014-10-28 10:11:12 -0400
commit28634394f53b9ab27d3419cfde047ee78e491d97 (patch)
tree00a7e45cf79d6b2b468b94d9c183a2c384929627 /docs
parent713f23492a52df8dbb4ae1175f5d0a0f3e2c4005 (diff)
Fixed #23606 -- Implemented Client and RequestFactory trace() methods.
Thanks KevinEtienne for the suggestion.
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.8.txt4
-rw-r--r--docs/topics/testing/advanced.txt4
-rw-r--r--docs/topics/testing/tools.txt14
3 files changed, 20 insertions, 2 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index eef836f6aa..23c6deeef1 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -372,6 +372,10 @@ Requests and Responses
Tests
^^^^^
+* The :class:`RequestFactory.trace() <django.test.RequestFactory>`
+ and :class:`Client.trace() <django.test.Client.trace>` methods were
+ implemented, allowing you to create ``TRACE`` requests in your tests.
+
* The ``count`` argument was added to
:meth:`~django.test.SimpleTestCase.assertTemplateUsed`. This allows you to
assert that a template was rendered a specific number of times.
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
index bbd8584328..d817cf4f02 100644
--- a/docs/topics/testing/advanced.txt
+++ b/docs/topics/testing/advanced.txt
@@ -21,8 +21,8 @@ restricted subset of the test client API:
* It only has access to the HTTP methods :meth:`~Client.get()`,
:meth:`~Client.post()`, :meth:`~Client.put()`,
- :meth:`~Client.delete()`, :meth:`~Client.head()` and
- :meth:`~Client.options()`.
+ :meth:`~Client.delete()`, :meth:`~Client.head()`,
+ :meth:`~Client.options()`, and :meth:`~Client.trace()`.
* These methods accept all the same arguments *except* for
``follows``. Since this is just a factory for producing
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index 43c5fcaf48..439910aa8a 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -316,6 +316,20 @@ Use the ``django.test.Client`` class to make requests.
The ``follow``, ``secure`` and ``extra`` arguments act the same as for
:meth:`Client.get`.
+ .. method:: Client.trace(path, follow=False, secure=False, **extra)
+
+ .. versionadded:: 1.8
+
+ Makes a TRACE request on the provided ``path`` and returns a
+ ``Response`` object. Useful for simulating diagnostic probes.
+
+ Unlike the other request methods, ``data`` is not provided as a keyword
+ parameter in order to comply with :rfc:`2616`, which mandates that
+ TRACE requests should not have an entity-body.
+
+ The ``follow``, ``secure``, and ``extra`` arguments act the same as for
+ :meth:`Client.get`.
+
.. method:: Client.login(**credentials)
If your site uses Django's :doc:`authentication system</topics/auth/index>`