Opened 7 years ago

Closed 7 years ago

#6945 closed (invalid)

django/test/client.py:encode_multipart cannot encode multiple files

Reported by: hto@… Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If one wants to test multiple file upload it would be nice if I could say

c.post(url, {'files':(a, b, c)}

where a, b, c are file-like objects. I could provide a patch if there is interes in this?

Change History (1)

comment:1 Changed 7 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

If you have multiple files being uploaded on a form, each one will be an independent <input type='file'>; as a result, your post dictionary should be {'file1':a,'file2':b,'file3:'c}.

Note: See TracTickets for help on using tickets.
Back to Top