Author: russellm
Date: 2009-07-03 02:47:05 -0500 (Fri, 03 Jul 2009)
New Revision: 11174
Modified:
django/branches/releases/1.0.X/
django/branches/releases/1.0.X/docs/topics/testing.txt
Log:
[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.
Property changes on: django/branches/releases/1.0.X
___________________________________________________________________
Name: svnmerge-integrated
-
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10505,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10624-10626,10631,10639-10641,10643,10646,10652-10655,10659-10660,10666-10669,10675,10682-10690,10693,10697-10704,10707,10713-10714,10723,10725,10727,10729,10732,10743-10750,10752-10760,10768,10770,10772,10774,10777,10782,10787,10789,10791,10795,10797,10799,10801,10805,10808,10810,10812,10814,10816,10819,10822,10828,10831,10833,10835,10837,10839,10841,10843,10845,10847,10849,10861,10863,10913-10914,10952,10970-10973,10979,10981,10983,10985,11007,11009,11019,11021-11022,11025-11026,11028,11041,11043-11054,11067-11068,11079,11093-11097,11103,11119-11120,11125,11127,11155,11162-11164,11169-11170
+
/django/trunk:1-9097,9099-9102,9104-9109,9111,9113-9144,9146-9151,9153-9156,9158-9159,9161-9187,9189-9247,9249-9262,9264-9277,9279-9298,9301-9302,9305-9331,9333-9343,9345,9347,9350-9352,9355-9396,9399-9462,9466-9469,9471-9488,9491-9526,9529,9533-9536,9539-9550,9556-9557,9559-9560,9562-9568,9570-9591,9595-9619,9621-9624,9626-9636,9638-9642,9644-9645,9647-9689,9691-9699,9703-9706,9709-9713,9716-9723,9725-9726,9730-9738,9740-9741,9750-9751,9757-9758,9761-9762,9767-9768,9770-9780,9782-9784,9789-9790,9793-9798,9801-9802,9806-9807,9809-9813,9821-9837,9842-9843,9847-9859,9861,9863-9875,9877-9881,9883-9887,9899-9903,9906-9909,9912,9914,9916-9917,9919-9920,9922-9927,9929,9931-9937,9939,9942-9943,9945-9950,9953-9954,9956-9962,9966-9977,9979-9984,9986-9988,9990-10001,10003-10004,10007,10009-10010,10013-10017,10019-10020,10022-10025,10031,10036-10041,10049-10052,10054-10061,10066-10069,10071-10076,10078-10079,10085-10087,10104,10106,10125-10127,10136,10138-10140,10143,10145-10147,10149-10160,10163-10167,10170,10173,10175-10176,10180,10185,10189,10192-10196,10198-10221,10223-10228,10230-10234,10236-10247,10250-10257,10259-10270,10273-10274,10276-10280,10282-10314,10316,10319-10322,10324-10325,10328-10329,10333-10344,10348-10351,10353-10356,10358-10363,10365-10368,10371-10380,10386-10407,10411,10413-10427,10429-10437,10440-10442,10444-10445,10447-10450,10452-10453,10457-10464,10466-10467,10469-10480,10482-10485,10489-10492,10495-10497,10499-10505,10508-10509,10511-10514,10517-10520,10524-10525,10528,10530-10537,10539-10548,10550-10557,10561,10563-10564,10567-10571,10573-10574,10576-10578,10580-10589,10591-10592,10595-10596,10599-10601,10603-10620,10624-10626,10631,10639-10641,10643,10646,10652-10655,10659-10660,10666-10669,10675,10682-10690,10693,10697-10704,10707,10713-10714,10723,10725,10727,10729,10732,10743-10750,10752-10760,10768,10770,10772,10774,10777,10782,10787,10789,10791,10795,10797,10799,10801,10805,10808,10810,10812,10814,10816,10819,10822,10828,10831,10833,10835,10837,10839,10841,10843,10845,10847,10849,10861,10863,10913-10914,10952,10970-10973,10979,10981,10983,10985,11007,11009,11019,11021-11022,11025-11026,11028,11041,11043-11054,11067-11068,11079,11093-11097,11103,11119-11120,11125,11127,11155,11162-11164,11169-11170,11173
Modified: django/branches/releases/1.0.X/docs/topics/testing.txt
===================================================================
--- django/branches/releases/1.0.X/docs/topics/testing.txt 2009-07-03
07:40:45 UTC (rev 11173)
+++ django/branches/releases/1.0.X/docs/topics/testing.txt 2009-07-03
07:47:05 UTC (rev 11174)
@@ -479,7 +479,7 @@
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,8 +494,19 @@
/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 @@
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---