Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a bug in the way file uploads were constructed. The new behaviour

should emulate a form upload more accurately.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a4d773b5801b91553ffe097840d770d2ea2b8b23 1 parent 5c34684
@malcolmt malcolmt authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 django/test/client.py
View
7 django/test/client.py
@@ -65,10 +65,7 @@ def encode_multipart(boundary, data):
if isinstance(value, file):
lines.extend([
'--' + boundary,
- 'Content-Disposition: form-data; name="%s"' % key,
- '',
- '--' + boundary,
- 'Content-Disposition: form-data; name="%s_file"; filename="%s"' % (key, value.name),
+ 'Content-Disposition: form-data; name="%s"; filename="%s"' % (key, value.name),
'Content-Type: application/octet-stream',
'',
value.read()
@@ -251,4 +248,4 @@ def login(self, **credentials):
return True
else:
return False
-
+
Please sign in to comment.
Something went wrong with that request. Please try again.