[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful/tests -
test_instance.py:1.18
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Apr 15 18:11:40 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/workflow/stateful/tests
In directory cvs.zope.org:/tmp/cvs-serv8703/src/zope/app/workflow/stateful/tests
Modified Files:
test_instance.py
Log Message:
Got rid of workflow service.
=== Zope3/src/zope/app/workflow/stateful/tests/test_instance.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_instance.py:1.17 Sat Mar 13 18:01:17 2004
+++ Zope3/src/zope/app/workflow/stateful/tests/test_instance.py Thu Apr 15 18:11:09 2004
@@ -22,31 +22,33 @@
from zope.schema import Text, Int
from zope.component.service import serviceManager
-from zope.app.event.tests.placelesssetup import \
- eventPublisher, EventRecorder, events, clearEvents
+from zope.app.event.tests.placelesssetup import eventPublisher, EventRecorder
+from zope.app.event.tests.placelesssetup import events, clearEvents
from zope.app.security.interfaces import IPermission
from zope.app.security.permission import Permission
from zope.security.checker import CheckerPublic
from zope.security.management import newSecurityManager
+from zope.app.annotation.interfaces import IAttributeAnnotatable
from zope.app.registration.interfaces import IRegisterable
from zope.app.registration.interfaces import IRegistered
from zope.app.registration.interfaces import ActiveStatus
-from zope.app.annotation.interfaces import IAttributeAnnotatable
+from zope.app.servicenames import Utilities
from zope.app.workflow.tests.workflowsetup import WorkflowSetup
from zope.app.workflow.interfaces import IProcessDefinition
-from zope.app.workflow.interfaces.stateful \
- import IStatefulProcessInstance
-from zope.app.workflow.interfaces.stateful import \
- IBeforeTransitionEvent, IAfterTransitionEvent
+from zope.app.workflow.instance import createProcessInstance
+from zope.app.workflow.interfaces.stateful import IStatefulProcessInstance
+from zope.app.workflow.interfaces.stateful import IBeforeTransitionEvent
+from zope.app.workflow.interfaces.stateful import IAfterTransitionEvent
from zope.app.workflow.interfaces.stateful import IRelevantDataChangeEvent
-from zope.app.workflow.interfaces.stateful import \
- IBeforeRelevantDataChangeEvent, IAfterRelevantDataChangeEvent
-from zope.app.workflow.stateful.definition \
- import StatefulProcessDefinition, State, Transition
-from zope.app.workflow.stateful.instance \
- import StatefulProcessInstance, StateChangeInfo
+from zope.app.workflow.interfaces.stateful import IBeforeRelevantDataChangeEvent
+from zope.app.workflow.interfaces.stateful import IAfterRelevantDataChangeEvent
+from zope.app.workflow.stateful.definition import StatefulProcessDefinition
+from zope.app.workflow.stateful.definition import State, Transition
+from zope.app.workflow.stateful.instance import StatefulProcessInstance
+from zope.app.workflow.stateful.instance import StateChangeInfo
+
from zope.app import zapi
from zope.app.tests import ztapi
from zope.app.container.contained import contained
@@ -99,9 +101,10 @@
zapi.traverse(self.default.getRegistrationManager(),
name).status = ActiveStatus
- self.pd = self.service.getProcessDefinition('definition1')
+ utilities = zapi.getService(self.sm, Utilities)
+ self.pd = utilities.getUtility(IProcessDefinition, 'definition1')
# give the pi some context to find a service
- self.pi = self.service.createProcessInstance('definition1')
+ self.pi = createProcessInstance(self.sm, 'definition1')
# Let's also listen to the fired events
clearEvents()
eventPublisher.globalSubscribe(EventRecorder)
@@ -211,10 +214,11 @@
zapi.traverse(self.default.getRegistrationManager(), n
).status = ActiveStatus
- self.pd = self.service.getProcessDefinition('definition1')
+ utilities = zapi.getService(self.sm, Utilities)
+ self.pd = utilities.getUtility(IProcessDefinition, 'definition1')
# give the pi some context to find a service
self.pi = contained(
- self.service.createProcessInstance('definition1'),
+ createProcessInstance(self.sm, 'definition1'),
self.rootFolder)
def testConditionalTranstitions(self):
@@ -297,10 +301,11 @@
zapi.traverse(self.default.getRegistrationManager(),
k).status = ActiveStatus
- self.pd = self.service.getProcessDefinition('definition1')
+ utilities = zapi.getService(self.sm, Utilities)
+ self.pd = utilities.getUtility(IProcessDefinition, 'definition1')
# give the pi some context to find a service
self.pi = contained(
- self.service.createProcessInstance('definition1'),
+ createProcessInstance(self.sm, 'definition1'),
self.rootFolder)
def testConditionalTranstitions(self):
@@ -382,14 +387,15 @@
zapi.traverse(self.default.getRegistrationManager(),
k).status = ActiveStatus
- self.pd = self.service.getProcessDefinition('definition1')
+ utilities = zapi.getService(self.sm, Utilities)
+ self.pd = utilities.getUtility(IProcessDefinition, 'definition1')
# give the process instance container (pic) some context to find a
# service (while this is not correct, it resembles the current
# behavior.
from zope.app.workflow.instance import ProcessInstanceContainerAdapter
pic = ProcessInstanceContainerAdapter(self.rootFolder)
self.pi = contained(
- self.service.createProcessInstance('definition1'),
+ createProcessInstance(self.sm, 'definition1'),
pic)
def testPermissionedTranstitions(self):
More information about the Zope3-Checkins
mailing list