[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component/tests - test_interfacewidget.py:1.12

Steve Alexander steve@cat-box.net
Thu, 9 Jan 2003 07:58:56 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/component/tests
In directory cvs.zope.org:/tmp/cvs-serv628/src/zope/app/browser/component/tests

Modified Files:
	test_interfacewidget.py 
Log Message:
removed another XXX demanding a test, in exchange for a test


=== Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py:1.11	Thu Jan  9 04:37:16 2003
+++ Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py	Thu Jan  9 07:58:54 2003
@@ -268,6 +268,29 @@
 
         self.assertEqual(widget(), out)
 
+        # test that None / Anything disappears when there is a search string
+
+        request.form["field.TestName.search"] = (
+        'two'
+        )
+
+        out = (
+        '<input type="text" name="field.TestName.search" value="two">'
+        '<select name="field.TestName">'
+        '<option value="">---select interface---</option>'
+
+        '<option value="'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '">'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '</option>'
+
+        '</select>'
+        )
+
+        self.assertEqual(widget(), out)
+
+
     def testBadInterfaceName(self):
         request = self.request
         field = InterfaceField(__name__='TestName',
@@ -635,6 +658,59 @@
         '">'
         'zope.app.browser.component.tests.test_interfacewidget.I2'
         '</option>'
+        '<option value="'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '">'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '</option>'
+
+        '</select>'
+        )
+        self.assertEqual(widget(), out)
+
+        # test that None / Anything disappears when there is a search string
+        
+        request.form["field.TestName.search.i1"] = 'two'
+
+        out = (
+        'Use refresh to enter more interfaces'
+        '<br>'
+
+        '<input type="text" name="field.TestName.search.i0" value="">'
+
+        '<select name="field.TestName.i0">'
+
+        '<option value="">---select interface---</option>'
+        '<option value="'
+        'None'
+        '">'
+        'Anything'
+        '</option>'
+        '<option value="'
+        'zope.app.browser.component.tests.test_interfacewidget.I'
+        '">'
+        'zope.app.browser.component.tests.test_interfacewidget.I'
+        '</option>'
+        '<option value="'
+        'zope.app.browser.component.tests.test_interfacewidget.I2'
+        '">'
+        'zope.app.browser.component.tests.test_interfacewidget.I2'
+        '</option>'
+        '<option value="'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '">'
+        'zope.app.browser.component.tests.test_interfacewidget.I3'
+        '</option>'
+
+        '</select>'
+
+        '<br>'
+
+        '<input type="text" name="field.TestName.search.i1" value="two">'
+
+        '<select name="field.TestName.i1">'
+
+        '<option value="">---select interface---</option>'
         '<option value="'
         'zope.app.browser.component.tests.test_interfacewidget.I3'
         '">'