Author: russellm
Date: 2010-05-09 01:48:32 -0500 (Sun, 09 May 2010)
New Revision: 13172

Modified:
   django/branches/releases/1.1.X/docs/topics/testing.txt
Log:
[1.1.X] Fixed #12412 -- Clarified the documentation around file handling by the 
test client. Thanks to Gabriel Hurley for the draft patch.

Backport of r13166 from trunk.

Modified: django/branches/releases/1.1.X/docs/topics/testing.txt
===================================================================
--- django/branches/releases/1.1.X/docs/topics/testing.txt      2010-05-09 
06:45:21 UTC (rev 13171)
+++ django/branches/releases/1.1.X/docs/topics/testing.txt      2010-05-09 
06:48:32 UTC (rev 13172)
@@ -577,9 +577,17 @@
         (The name ``attachment`` here is not relevant; use whatever name your
         file-processing code expects.)
 
-        Note that you should manually close the file after it has been provided
-        to ``post()``.
+        Note that if you wish to use the same file handle for multiple
+        ``post()`` calls then you will need to manually reset the file
+        pointer between posts. The easiest way to do this is to
+        manually close the file after it has been provided to
+        ``post()``, as demonstrated above.
 
+        You should also ensure that the file is opened in a way that
+        allows the data to be read. If your file contains binary data
+        such as an image, this means you will need to open the file in
+        ``rb`` (read binary) mode.
+
         The ``extra`` argument acts the same as for :meth:`Client.get`.
 
         .. versionchanged:: 1.1

-- 
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.

Reply via email to