testbrowser does not handle empty file fields properly

Bug #98458 reported by Martijn Faassen
4
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Medium
Benji York
zope.testbrowser
Fix Released
Medium
Benji York

Bug Description

When you have a form with a file field 'foo' that's not required, and you submit this form with a browser that's not testbrowser, the file field 'foo' will end up in request.form, with key 'form.foo' and value u''. If you submit it with testbrowser, the file will be completely missing from request.form though. This is an imcompatibility which makes it hard to fully test non-required file fields with testbrowser.

Revision history for this message
Thomas Herve (therve) wrote :

The attached patch (with a test) fixes the problem for me. It's against some version around 3.4 I think.

Tres Seaver (tseaver)
Changed in zope.testing:
assignee: nobody → Benji York (benji-york)
importance: Undecided → Medium
status: New → Confirmed
Changed in zope3:
status: Confirmed → Won't Fix
Revision history for this message
Adam Groszer (agroszer) wrote :

The patch fixes Clientform...

Revision history for this message
Tres Seaver (tseaver) wrote :

The patch applies against ClientForm.py from the 0.2.9 release, but not against the version from the 0.2.10 release, which already adds special-case handling for the "no uploaded files" case.

affects: zope.testing → zope.testbrowser
Changed in zope.testbrowser:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.