[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/Views/Browser/tests - testBrowserWidget.py:1.6.8.2

Jim Fulton jim@zope.com
Thu, 12 Dec 2002 11:09:10 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Forms/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv30233/tests

Modified Files:
      Tag: AdapterAndView-branch
	testBrowserWidget.py 
Log Message:
Fixed a bug in _showData (used to get data to be displayed in an edit
widget). We failed to use field defaults when there was no initial
data pr request data.


=== Zope3/lib/python/Zope/App/Forms/Views/Browser/tests/testBrowserWidget.py 1.6.8.1 => 1.6.8.2 ===
--- Zope3/lib/python/Zope/App/Forms/Views/Browser/tests/testBrowserWidget.py:1.6.8.1	Thu Dec 12 10:16:50 2002
+++ Zope3/lib/python/Zope/App/Forms/Views/Browser/tests/testBrowserWidget.py	Thu Dec 12 11:09:09 2002
@@ -109,6 +109,13 @@
         self._widget.request.form['field.foo'] = u''
         self.failIf(self._widget.haveData())
 
+    def test_showData_w_default(self):
+        field = Text(__name__ = 'foo', title = u"Foo Title", default=u"def")
+        request = TestRequest()
+        widget = self._WidgetFactory(field, request)
+        self.assertEqual(widget._showData(), u'def')
+        
+
 def test_suite():
     return unittest.makeSuite(Test)