[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/textwidgets.py A change to the way file-upload widgets worked caused old functional tests to

Jim Fulton jim at zope.com
Sat Jul 30 11:04:17 EDT 2005


Log message for revision 37598:
  A change to the way file-upload widgets worked caused old functional tests to
  fail. They now check for a "used" variable to verify that the
  file-widget was used even if there is no data. I broadened the check
  to recognize input if either the data are present or the "used" flag
  is present.  This allows old tests using file widgets to pass.
  

Changed:
  U   Zope3/trunk/src/zope/app/form/browser/textwidgets.py

-=-
Modified: Zope3/trunk/src/zope/app/form/browser/textwidgets.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/textwidgets.py	2005-07-30 14:33:39 UTC (rev 37597)
+++ Zope3/trunk/src/zope/app/form/browser/textwidgets.py	2005-07-30 15:04:16 UTC (rev 37598)
@@ -446,7 +446,10 @@
                 return self.context.missing_value
 
     def hasInput(self):
-        return self.name+".used" in self.request.form
+        return ((self.name+".used" in self.request.form)
+                or
+                (self.name in self.request.form)
+                )
 
 class IntWidget(TextWidget):
     """Integer number widget.



More information about the Zope3-Checkins mailing list