Ticket #16916: 16916.diff

File 16916.diff, 1.6 KB (added by raulcd, 4 years ago)

First patch

  • docs/topics/testing.txt

    diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
    index f4c06e5..602d2e8 100644
    a b Note a few important things about how the test client works: 
    664664Making requests
    667 Use the ``django.test.client.Client`` class to make requests. It requires no
    668 arguments at time of construction:
     667Use the ``django.test.client.Client`` class to make requests.
    670669.. class:: Client()
    672     Once you have a ``Client`` instance, you can call any of the following
    673     methods:
     671    It requires no arguments at time of construction but you can provide some
     672    default values:
     674    .. method:: Client.__init__(enforce_csrf_checks=False, **defaults)
     677        Creates an instance of the test client. By default the test client
     678        will disable any CSRF checks performed by your site due to the default
     679        ``enforce_csrf_checks`` value.
     681        The ``defaults`` keywords argument parameter can be used to specify
     682        some default headers to be sent in the request. For example::
     684            >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0')
     686        ...will send the HTTP header ``HTTP_USER_AGENT`` on further requests.
     688        The values from the ``extra`` keywords argument on the
     689        :meth:`django.test.client.Client.get()`,
     690        :meth:`django.test.client.Client.post()`,
     691        :meth:`django.test.client.Client.delete()`
     692        , etc. have precedence than those defaults provided.
     694        Once you have a ``Client`` instance, you can call any of the following
     695        methods:
    675697    .. method:: Client.get(path, data={}, follow=False, **extra)
Back to Top