Browse Source

Added missing mode="rb" argument to open() call in Client.post() example in docs.

John 4 năm trước cách đây
mục cha
commit
509d266c6a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      docs/topics/testing/tools.txt

+ 1 - 1
docs/topics/testing/tools.txt

@@ -244,7 +244,7 @@ Use the ``django.test.Client`` class to make requests.
         wish to upload as a value. For example::
 
             >>> c = Client()
-            >>> with open('wishlist.doc') as fp:
+            >>> with open('wishlist.doc', 'rb') as fp:
             ...     c.post('/customers/wishes/', {'name': 'fred', 'attachment': fp})
 
         (The name ``attachment`` here is not relevant; use whatever name your