mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixes #3212 -- Added code to test client to allow posting of multi-form values (e.g., MultipleChoiceFields). Thanks, Ben Dean Kawamura.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -69,6 +69,14 @@ def encode_multipart(boundary, data):
|
||||
'',
|
||||
value.read()
|
||||
])
|
||||
elif hasattr(value, '__iter__'):
|
||||
for item in value:
|
||||
lines.extend([
|
||||
'--' + boundary,
|
||||
'Content-Disposition: form-data; name="%s"' % key,
|
||||
'',
|
||||
str(item)
|
||||
])
|
||||
else:
|
||||
lines.extend([
|
||||
'--' + boundary,
|
||||
|
||||
Reference in New Issue
Block a user