[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Forms/tests - testUtility.py:1.9

Jim Fulton jim@zope.com
Sun, 22 Dec 2002 16:25:12 -0500


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

Modified Files:
	testUtility.py 
Log Message:
Changed the getWidgetsData and getWidgetsDataForContent utility
functions to allow missing data for non-req1uired fields.


=== Zope3/lib/python/Zope/App/Forms/tests/testUtility.py 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/Forms/tests/testUtility.py:1.8	Thu Dec 19 14:51:43 2002
+++ Zope3/lib/python/Zope/App/Forms/tests/testUtility.py	Sun Dec 22 16:25:12 2002
@@ -347,13 +347,15 @@
         setUpWidgets(view, I, initial=kw(title=u"ttt", description=u"ddd"))
         self.assertEqual(getWidgetsData(view, I, required=0), {})
 
-        self.assertRaises(MissingInputError, getWidgetsData, view, I)
+        self.assertRaises(MissingInputError, getWidgetsData, view, I2)
+        self.assertEqual(getWidgetsData(view, I), {})
 
         request.form['field.description'] = u'fd'
-        self.assertEqual(getWidgetsData(view, I, required=0),
+        self.assertEqual(getWidgetsData(view, I2, required=0),
                          {'description': u'fd'})
 
-        self.assertRaises(MissingInputError, getWidgetsData, view, I)
+        self.assertRaises(MissingInputError, getWidgetsData, view, I2)
+        self.assertEqual(getWidgetsData(view, I), {'description': u'fd'})
 
     def test_getWidgetsDataForContent(self):
         c = C()