[Zope3-checkins] CVS: Zope3/src/zope/app/tests - placelesssetup.py:1.6 setup.py:1.3
Steve Alexander
steve@cat-box.net
Thu, 5 Jun 2003 08:03:50 -0400
Update of /cvs-repository/Zope3/src/zope/app/tests
In directory cvs.zope.org:/tmp/cvs-serv15171/src/zope/app/tests
Modified Files:
placelesssetup.py setup.py
Log Message:
Placeful setup for tests now sets up a ZopeContainerDecorator.
This means that in such tests, you no longer need to use
ZopeContainerAdapter to get the correct events issued, and perform context-
wrapping duties, when you use a container.
However, it does mean that your tests need to expect these events and
context-wrappers to be used.
=== Zope3/src/zope/app/tests/placelesssetup.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/tests/placelesssetup.py:1.5 Thu May 22 18:48:07 2003
+++ Zope3/src/zope/app/tests/placelesssetup.py Thu Jun 5 08:03:19 2003
@@ -18,23 +18,27 @@
"""
from zope.component.tests.placelesssetup \
- import PlacelessSetup as CAPlacelessSetup
+ import PlacelessSetup as CAPlacelessSetup
from zope.app.component.tests.placelesssetup \
- import PlacelessSetup as ACAPlacelessSetup
+ import PlacelessSetup as ACAPlacelessSetup
from zope.app.event.tests.placelesssetup \
- import PlacelessSetup as EventPlacelessSetup
+ import PlacelessSetup as EventPlacelessSetup
from zope.app.i18n.tests.placelesssetup \
- import PlacelessSetup as I18nPlacelessSetup
+ import PlacelessSetup as I18nPlacelessSetup
+from zope.app.container.tests.placelesssetup \
+ import PlacelessSetup as ContainerPlaclessSetup
from zope.app.security._protections import protect
class PlacelessSetup(CAPlacelessSetup,
ACAPlacelessSetup,
EventPlacelessSetup,
I18nPlacelessSetup,
+ ContainerPlaclessSetup
):
def setUp(self):
CAPlacelessSetup.setUp(self)
+ ContainerPlaclessSetup.setUp(self)
ACAPlacelessSetup.setUp(self)
EventPlacelessSetup.setUp(self)
I18nPlacelessSetup.setUp(self)
=== Zope3/src/zope/app/tests/setup.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/tests/setup.py:1.2 Wed Jun 4 10:57:58 2003
+++ Zope3/src/zope/app/tests/setup.py Thu Jun 5 08:03:19 2003
@@ -20,6 +20,7 @@
from zope.app import zapi
from zope.component.adapter import provideAdapter
from zope.component.view import provideView
+from zope.interface import classImplements
#------------------------------------------------------------------------
# Annotations
@@ -35,8 +36,8 @@
from zope.app.dependable import Dependable
from zope.app.interfaces.dependable import IDependable
def setUpDependable():
- provideAdapter(IAttributeAnnotatable, IDependable, Dependable)
-
+ provideAdapter(IAttributeAnnotatable, IDependable,
+ Dependable)
#------------------------------------------------------------------------
# Traversal
@@ -175,7 +176,9 @@
defineService(HubIds, IObjectHub)
-
+ # EventService must be IAttributeAnnotatable so that it can support
+ # dependencies.
+ classImplements(EventService, IAttributeAnnotatable)
events = EventService()
addService(sm, EventPublication, events)
addService(sm, EventSubscription, events, suffix='sub')