diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-05-25 19:03:15 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-05-25 19:03:15 +0200 |
| commit | e73838b6ddcc7b37c03f9eee04fa6e6a283fedb3 (patch) | |
| tree | 08031fd77bbf72a54ebc9054de68a9e299934b20 /docs/topics | |
| parent | 323b414441e13681c2a4117dc7043926f938f48a (diff) | |
Fixed #17371 -- Made the test client more flexible
The OPTIONS, PUT and DELETE methods no longer apply arbitrary
data encoding (in the query string or in the request body).
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/testing.txt | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index d5ccc2d8fc..f35c545c30 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -805,45 +805,56 @@ arguments at time of construction: .. method:: Client.head(path, data={}, follow=False, **extra) - 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. + Makes a HEAD request on the provided ``path`` and returns a + ``Response`` object. This method works just like :meth:`Client.get`, + including the ``follow`` and ``extra`` arguments, except it does not + return a message body. - If you set ``follow`` to ``True`` the client will follow any redirects - and a ``redirect_chain`` attribute will be set in the response object - containing tuples of the intermediate urls and status codes. - - .. method:: Client.options(path, data={}, follow=False, **extra) + .. method:: Client.options(path, data='', content_type='application/octet-stream', follow=False, **extra) Makes an OPTIONS request on the provided ``path`` and returns a ``Response`` object. Useful for testing RESTful interfaces. - If you set ``follow`` to ``True`` the client will follow any redirects - and a ``redirect_chain`` attribute will be set in the response object - containing tuples of the intermediate urls and status codes. + When ``data`` is provided, it is used as the request body, and + a ``Content-Type`` header is set to ``content_type``. - The ``extra`` argument acts the same as for :meth:`Client.get`. + .. versionchanged:: 1.5 + :meth:`Client.options` used to process ``data`` like + :meth:`Client.get`. + + The ``follow`` and ``extra`` arguments act the same as for + :meth:`Client.get`. - .. method:: Client.put(path, data={}, content_type=MULTIPART_CONTENT, follow=False, **extra) + .. method:: Client.put(path, data='', content_type='application/octet-stream', follow=False, **extra) Makes a PUT request on the provided ``path`` and returns a - ``Response`` object. Useful for testing RESTful interfaces. Acts just - like :meth:`Client.post` except with the PUT request method. + ``Response`` object. Useful for testing RESTful interfaces. - If you set ``follow`` to ``True`` the client will follow any redirects - and a ``redirect_chain`` attribute will be set in the response object - containing tuples of the intermediate urls and status codes. + When ``data`` is provided, it is used as the request body, and + a ``Content-Type`` header is set to ``content_type``. + + .. versionchanged:: 1.5 + :meth:`Client.put` used to process ``data`` like + :meth:`Client.post`. - .. method:: Client.delete(path, follow=False, **extra) + The ``follow`` and ``extra`` arguments act the same as for + :meth:`Client.get`. + + .. method:: Client.delete(path, data='', content_type='application/octet-stream', follow=False, **extra) Makes an DELETE request on the provided ``path`` and returns a ``Response`` object. Useful for testing RESTful interfaces. - If you set ``follow`` to ``True`` the client will follow any redirects - and a ``redirect_chain`` attribute will be set in the response object - containing tuples of the intermediate urls and status codes. + When ``data`` is provided, it is used as the request body, and + a ``Content-Type`` header is set to ``content_type``. + + .. versionchanged:: 1.5 + :meth:`Client.delete` used to process ``data`` like + :meth:`Client.get`. + + The ``follow`` and ``extra`` arguments act the same as for + :meth:`Client.get`. - The ``extra`` argument acts the same as for :meth:`Client.get`. .. method:: Client.login(**credentials) |
