[Zope3-checkins] CVS: Zope3/src/zope/app/form/tests - test_utility.py:1.4

R. David Murray bitz@bitdance.com
Mon, 27 Jan 2003 21:57:16 -0500


Update of /cvs-repository/Zope3/src/zope/app/form/tests
In directory cvs.zope.org:/tmp/cvs-serv8113/zope/app/form/tests

Modified Files:
	test_utility.py 
Log Message:
zope.app.form.utility had a function, fieldNames, that returned a
list of the Fields in a schema in schema order.  This is exactly
parallel to getFieldsInOrder from the schema package itself, and
it seems to me that's where it belongs.  So I added a getFieldNamesInOrder
function to schema.  I also added a getFieldNames in parallel to
getFields, to complete the set.  Everything that used fieldNames
is converted to use getFieldNamesInOrder.

The unit tests from form was actually a little stronger than those
in schema:  it made sure that all fields were returned when using
a derived schema, which the schema tests didn't.  So I added some
subschema tests to the schema test suite in addition to the tests
for the new functions themselves.



=== Zope3/src/zope/app/form/tests/test_utility.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/form/tests/test_utility.py:1.3	Thu Jan  9 09:13:10 2003
+++ Zope3/src/zope/app/form/tests/test_utility.py	Mon Jan 27 21:56:43 2003
@@ -32,7 +32,7 @@
 from zope.app.interfaces.form import WidgetsError, MissingInputError
 from zope.app.form.utility import setUpWidget, setUpWidgets, setUpEditWidgets
 from zope.app.form.utility import getWidgetsData, getWidgetsDataForContent
-from zope.app.form.utility import haveWidgetsData, fieldNames
+from zope.app.form.utility import haveWidgetsData
 from zope.schema.interfaces import ValidationError
 from zope.component.interfaces import IViewFactory
 
@@ -99,17 +99,6 @@
         PlacelessSetup.setUp(self)
         setDefaultViewName(IText, IBrowserPresentation, 'edit')
         provideView(IText, 'edit', IBrowserPresentation, W)
-
-    def test_fieldNames(self):
-
-        class I3(I2):
-            foo = Text()
-            bar = Text()
-            foo2 = Text()
-
-        self.assertEqual(tuple(fieldNames(I3)),
-                         ('title', 'description', 'foo', 'bar', 'foo2'))
-
 
 
     def test_setUpWidget(self):