mirror of
https://github.com/django/django.git
synced 2025-04-08 15:36:47 +00:00
[3.2.x] Added missing mode="rb" argument to open() call in Client.post() example in docs.
Backport of 509d266c6aae5e4d5738fe2a2cba0bde581aac2b from main
This commit is contained in:
parent
5ebb8e65df
commit
57d456319d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user