Commit 7b5869e1 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

[1.0.X] Fixed #9607 -- Added documentation for the ``extra`` argument in test...

[1.0.X] Fixed #9607 -- Added documentation for the ``extra`` argument in test client methods. Thanks to jroes for the report and patch.

Merge of r11173 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 40f24b46
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ arguments at time of construction:
    Once you have a ``Client`` instance, you can call any of the following
    methods:

    .. method:: Client.get(path, data={})
    .. method:: Client.get(path, data={}, **extra)

        Makes a GET request on the provided ``path`` and returns a ``Response``
        object, which is documented below.
@@ -494,7 +494,18 @@ arguments at time of construction:

            /customers/details/?name=fred&age=7

    .. method:: Client.post(path, data={}, content_type=MULTIPART_CONTENT)
        The ``extra`` keyword arguments parameter can be used to specify
        headers to be sent in the request. For example::

            >>> c = Client()
            >>> c.get('/customers/details/', {'name': 'fred', 'age': 7},
            ...       HTTP_X_REQUESTED_WITH='XMLHttpRequest')

        ...will send the HTTP header ``HTTP_X_REQUESTED_WITH`` to the
        details	view, which is a good way to test code paths that use the
        :meth:`django.http.HttpRequest.is_ajax()` method.

    .. method:: Client.post(path, data={}, content_type=MULTIPART_CONTENT, **extra)

        Makes a POST request on the provided ``path`` and returns a
        ``Response`` object, which is documented below.
@@ -545,6 +556,8 @@ arguments at time of construction:
        Note that you should manually close the file after it has been provided
        to ``post()``.

        The ``extra`` argument acts the same as for :meth:`Client.get`.

    .. method:: Client.login(**credentials)

        .. versionadded:: 1.0