﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2860	Test client only supports file uploads with foo and foo_file parameters	dave AT avaragado.org	nobody	"I'm using a custom manipulator with an ImageUploadField instance. This means I don't use the foo and foo_file system documented at http://www.djangoproject.com/documentation/forms/#filefield-and-imagefield-special-cases - my field is called foo, and that's the name of the form field output in the HTML, and the name of the parameter on the network.

Unfortunately, the test client doesn't appear to support this scenario. With code like this:

{{{
#!python
f = open('/my/test/file')
c.post('/foo/bar/', { 'foo': f })
f.close()
}}}

the test client transmogrifies my foo parameter into both foo and foo_file, with foo the empty string and foo_file the uploaded file itself. Sadly this is not what my manipulator is expecting, and hilarity ensues.

There's a simple workaround in the manipulator: overwrite foo with foo_file, if present. Shame it's needed though, as it's a hack to make the tests pass."	defect	closed	Testing framework	dev	normal	wontfix			Accepted	0	0	0	0	0	0
