Opened 10 years ago

Closed 9 years ago

#2860 closed defect (wontfix)

Test client only supports file uploads with foo and foo_file parameters

Reported by: dave AT Owned by: nobody
Component: Testing framework Version: master
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I'm using a custom manipulator with an ImageUploadField instance. This means I don't use the foo and foo_file system documented at - 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:

f = open('/my/test/file')'/foo/bar/', { 'foo': f })

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.

Change History (3)

comment:1 Changed 10 years ago by russellm

  • Owner changed from adrian to russellm

comment:2 Changed 9 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 9 years ago by russellm

  • Resolution set to wontfix
  • Status changed from new to closed

This is no longer a problem with newforms and the new FileField and ImageField.

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