Ticket #16916: 16916.diff

File 16916.diff, 1.6 KB (added by Raúl Cumplido, 13 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
    665665~~~~~~~~~~~~~~~
    666666
    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.
    669668
    670669.. class:: Client()
    671670
    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:
     673
     674    .. method:: Client.__init__(enforce_csrf_checks=False, **defaults)
     675
     676
     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.
     680
     681        The ``defaults`` keywords argument parameter can be used to specify
     682        some default headers to be sent in the request. For example::
     683
     684            >>> c = Client(HTTP_USER_AGENT='Mozilla/5.0')
     685
     686        ...will send the HTTP header ``HTTP_USER_AGENT`` on further requests.
     687
     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.
     693
     694        Once you have a ``Client`` instance, you can call any of the following
     695        methods:
    674696
    675697    .. method:: Client.get(path, data={}, follow=False, **extra)
    676698
Back to Top