[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component - interfacewidget.py:1.6
Steve Alexander
steve@cat-box.net
Mon, 6 Jan 2003 14:10:28 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/component
In directory cvs.zope.org:/tmp/cvs-serv3794/src/zope/app/browser/component
Modified Files:
interfacewidget.py
Log Message:
Improved test coverage.
Fixed bugs in haveData().
=== Zope3/src/zope/app/browser/component/interfacewidget.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/component/interfacewidget.py:1.5 Mon Jan 6 13:39:28 2003
+++ Zope3/src/zope/app/browser/component/interfacewidget.py Mon Jan 6 14:09:55 2003
@@ -32,7 +32,7 @@
def haveData(self):
if self.name in self.request.form:
v = self.request.form[self.name]
- return v and nameToInterface(self.context, v)
+ return v and (v == 'None' or nameToInterface(self.context, v))
return False
def getData(self, optional=0):
@@ -143,8 +143,7 @@
field = self.context
for k,v in self.request.form.iteritems():
if k.startswith(name_i):
- # XXX write test for this code path
- if v and nameToInterface(field, v):
+ if v and (v == 'None' or nameToInterface(field, v)):
return True
return False