Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12412 -- Clarified the documentation around file handling by t…

…he test client. Thanks to Gabriel Hurley for the draft patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bae2fa6f5cfd6827c0bdd995fe72dbb6794b7f9d 1 parent 5a74f0c
Russell Keith-Magee authored May 09, 2010

Showing 1 changed file with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. 12  docs/topics/testing.txt
12  docs/topics/testing.txt
@@ -668,8 +668,16 @@ arguments at time of construction:
668 668
         (The name ``attachment`` here is not relevant; use whatever name your
669 669
         file-processing code expects.)
670 670
 
671  
-        Note that you should manually close the file after it has been provided
672  
-        to ``post()``.
  671
+        Note that if you wish to use the same file handle for multiple
  672
+        ``post()`` calls then you will need to manually reset the file
  673
+        pointer between posts. The easiest way to do this is to
  674
+        manually close the file after it has been provided to
  675
+        ``post()``, as demonstrated above.
  676
+
  677
+        You should also ensure that the file is opened in a way that
  678
+        allows the data to be read. If your file contains binary data
  679
+        such as an image, this means you will need to open the file in
  680
+        ``rb`` (read binary) mode.
673 681
 
674 682
         The ``extra`` argument acts the same as for :meth:`Client.get`.
675 683
 

0 notes on commit bae2fa6

Please sign in to comment.
Something went wrong with that request. Please try again.