1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #5888 -- Added methods to the test client to support HEAD, PUT, DELETE

and OPTIONS support. Thanks Scott Barr and Leah Culver.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-10-07 08:47:05 +00:00
parent 66c77d03d2
commit ed48b0b37e
6 changed files with 130 additions and 1 deletions

View File

@@ -544,6 +544,28 @@ arguments at time of construction:
Note that you should manually close the file after it has been provided
to ``post()``.
.. method:: Client.head(path, data={})
Makes a HEAD request on the provided ``path`` and returns a ``Response``
object. Useful for testing RESTful interfaces. Acts just like
:meth:`Client.get` except it does not return a message body.
.. method:: Client.options(path, data={})
Makes an OPTIONS request on the provided ``path`` and returns a
``Response`` object. Useful for testing RESTful interfaces.
.. method:: Client.put(path, data={}, content_type=MULTIPART_CONTENT)
Makes an PUT request on the provided ``path`` and returns a
``Response`` object. Useful for testing RESTful interfaces. Acts just
like :meth:`Client.put` except with the PUT request method.
.. method:: Client.delete(path)
Makes an DELETE request on the provided ``path`` and returns a
``Response`` object. Useful for testing RESTful interfaces.
.. method:: Client.login(**credentials)
.. versionadded:: 1.0