[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/configuration/tests - test_editconfiguration.py:1.2.10.1
Steve Alexander
steve@cat-box.net
Thu, 15 May 2003 10:49:57 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services/configuration/tests
In directory cvs.zope.org:/tmp/cvs-serv12712/src/zope/app/browser/services/configuration/tests
Modified Files:
Tag: stevea-decorators-branch
test_editconfiguration.py
Log Message:
More work on Decorators.
Converted existing tests to use decorators instead of ZopeContainerAdapter.
=== Zope3/src/zope/app/browser/services/configuration/tests/test_editconfiguration.py 1.2 => 1.2.10.1 ===
--- Zope3/src/zope/app/browser/services/configuration/tests/test_editconfiguration.py:1.2 Wed Apr 30 19:37:56 2003
+++ Zope3/src/zope/app/browser/services/configuration/tests/test_editconfiguration.py Thu May 15 10:49:26 2003
@@ -21,7 +21,6 @@
from unittest import TestCase, TestSuite, main, makeSuite
from zope.app.browser.services.configuration import EditConfiguration
-from zope.app.container.zopecontainer import ZopeContainerAdapter
from zope.app.event.tests.placelesssetup import getEvents
from zope.app.interfaces.container import IContainer
from zope.app.interfaces.container import IZopeContainer
@@ -36,6 +35,8 @@
from zope.publisher.browser import BrowserView
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.app.component.decoratorservice import registerDecoratorForClass
+from zope.proxy.context import ContextWrapper
class Container(dict):
__implements__ = IContainer, IContainmentRoot
@@ -50,15 +51,19 @@
class Test(PlacefulSetup, TestCase):
- def test_remove_objects(self):
+ def setUp(self):
+ PlacefulSetup.setUp(self)
+ registerDecoratorForClass(Container,
+ 'zope.app.container.contextdecorator',
+ 'context')
- provideAdapter(IContainer, IZopeContainer, ZopeContainerAdapter)
+ def test_remove_objects(self):
c1 = C()
c2 = C()
c7 = C()
d = Container({'1': c1, '2': c2, '7': c7})
-
+ d = ContextWrapper(d, None)
view = EditConfiguration(d, TestRequest())
view.remove_objects(['2', '7'])
self.assertEqual(d, {'1': c1})