[Zope3-checkins] CVS: Zope3/src/zope/app/browser/component/tests -
test_interfacewidget.py:1.30
Suresh Babu Eddala
sbabu at zeomega.com
Fri Mar 5 10:48:33 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/component/tests
In directory cvs.zope.org:/tmp/cvs-serv10249/src/zope/app/browser/component/tests
Modified Files:
test_interfacewidget.py
Log Message:
removed local interface service stuff, it uses global utility service.
=== Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py 1.29 => 1.30 ===
--- Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py:1.29 Wed Feb 25 18:02:15 2004
+++ Zope3/src/zope/app/browser/component/tests/test_interfacewidget.py Fri Mar 5 10:48:02 2004
@@ -24,11 +24,11 @@
from zope.app.browser.component.interfacewidget import InterfaceWidget
from zope.app.browser.component.interfacewidget import MultiInterfaceWidget
from zope.publisher.browser import TestRequest
-from zope.component.service import serviceManager
-from zope.app.services.servicenames import Interfaces
from zope.app.interfaces.form import ConversionError, WidgetInputError
-from zope.app.tests import setup
-
+from zope.app.tests import placelesssetup
+from zope.app.component.interface import getInterface
+from zope.app.component.interface import provideInterface
+
class I(Interface):
"""bah blah
"""
@@ -38,7 +38,7 @@
"""
class I3(Interface):
- """
+ """ahk
"""
def one():
"""method one"""
@@ -49,20 +49,19 @@
class BaseInterfaceWidgetTest(TestCase):
def setUp(self):
- setup.placefulSetUp()
- service = serviceManager.getService(Interfaces)
- service.provideInterface(
+ placelesssetup.setUp()
+ provideInterface(
'zope.app.browser.component.tests.test_interfacewidget.I', I)
- service.provideInterface(
+ provideInterface(
'zope.app.browser.component.tests.test_interfacewidget.I2', I2)
- service.provideInterface(
+ provideInterface(
'zope.app.browser.component.tests.test_interfacewidget.I3', I3)
request = TestRequest()
-
self.request = request
def tearDown(self):
- setup.placefulTearDown()
+ placelesssetup.tearDown()
+
class TestInterfaceWidget(BaseInterfaceWidgetTest):
@@ -167,6 +166,7 @@
'</select>'
)
+
self.assertEqual(widget(), out)
request.form["field.TestName.search"] = 'two'
@@ -183,6 +183,7 @@
'</select>'
)
+
self.assertEqual(widget(), out)
def testInterfaceWidget_search(self):
@@ -372,17 +373,17 @@
field = InterfaceField(__name__='TestName',
title=u"This is a test",
required=False)
-
widget = InterfaceWidget(field, request)
out = (
'<input type="hidden" name="field.TestName" value="None" />'
)
self.assertEqual(widget.hidden(), out)
-
+
request.form["field.TestName"] = (
'zope.app.browser.component.tests.test_interfacewidget.I2'
)
+
self.assertEqual(widget.getInputValue(), I2)
out = (
'<input type="hidden" name="field.TestName"'
@@ -911,7 +912,7 @@
renderInterfaceSelect(interfaces, selected, search_name,
search_string, select_name),
out)
-
+
def test_suite():
return TestSuite((makeSuite(TestInterfaceWidget),
makeSuite(TestMultiInterfaceWidget),
More information about the Zope3-Checkins
mailing list