mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #23606 -- Implemented Client and RequestFactory trace() methods.
Thanks KevinEtienne for the suggestion.
This commit is contained in:
committed by
Tim Graham
parent
713f23492a
commit
28634394f5
@@ -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
|
||||
|
||||
@@ -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>`
|
||||
|
||||
Reference in New Issue
Block a user