[Zope3-checkins] SVN: Zope3/branches/Zope-3.1/src/zope/app/form/browser/textwidgets.py Merged from trunk:

Jim Fulton jim at zope.com
Sat Jul 30 11:10:34 EDT 2005


Log message for revision 37599:
  Merged from trunk:
  
  r37598 | jim | 2005-07-30 11:04:16 -0400 (Sat, 30 Jul 2005) | 6 lines
  
  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/branches/Zope-3.1/src/zope/app/form/browser/textwidgets.py

-=-
Modified: Zope3/branches/Zope-3.1/src/zope/app/form/browser/textwidgets.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/form/browser/textwidgets.py	2005-07-30 15:04:16 UTC (rev 37598)
+++ Zope3/branches/Zope-3.1/src/zope/app/form/browser/textwidgets.py	2005-07-30 15:10:33 UTC (rev 37599)
@@ -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