value_from_datadict does not work for testing purpose
garaud opened this issue · comments
Hi,
I think MultiFileInput.value_from_datadict
does not return the correct type when getlist
is not a method of the files
parameter.
When I test my form where there is a MultiFileField
field, I use SimpleUploadedFile
as input data files and I got an error message such as No file was submitted. Check the encoding type on the form.
even if there is some content in the files
param.
Fix this replacing:
return [files.get(name)]
by
return files.get(name)
in value_from_datadict
method. files[name]
is already a list of Files.
Cheer,
Damien G.
Thanks for reporting this Damien! I'll look into this as soon as I am going to be back from my military service in about a month. Cheers
Just checking in for an update - I'd love to be able to test multi file uploads...