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

This commit is contained in:
John 2021-03-26 03:04:59 -04:00 committed by GitHub
parent 0860db225a
commit 509d266c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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