[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful/tests - test_instance.py:1.10.16.2

Marius Gedminas marius at pov.lt
Fri Mar 19 13:51:23 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/workflow/stateful/tests
In directory cvs.zope.org:/tmp/cvs-serv26650/src/zope/app/workflow/stateful/tests

Modified Files:
      Tag: mgedmin-events2-branch
	test_instance.py 
Log Message:
Added IParticipation and replaced the lists of principals in IInteraction with
a list of participations.  Made BaseRequest an IParticipation and replaced
request.user with request.principal everywhere.



=== Zope3/src/zope/app/workflow/stateful/tests/test_instance.py 1.10.16.1 => 1.10.16.2 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_instance.py:1.10.16.1	Mon Mar  8 13:43:42 2004
+++ Zope3/src/zope/app/workflow/stateful/tests/test_instance.py	Fri Mar 19 13:50:52 2004
@@ -30,7 +30,7 @@
      import permissionRegistry
 from zope.app.services.servicenames import Permissions
 from zope.security.checker import CheckerPublic
-from zope.security.management import newInteraction, getInteraction
+from zope.security.management import newInteraction
 
 from zope.app.interfaces.services.registration import IRegisterable
 from zope.app.interfaces.services.registration import IRegistered
@@ -54,6 +54,13 @@
 from zope.app.container.contained import contained
 
 
+class ParticipationStub:
+
+    def __init__(self, principal):
+        self.principal = principal
+        self.interaction = None
+
+
 # define and create ProcessDefinition (PD) for tests
 class TestProcessDefinition(StatefulProcessDefinition):
     implements(IAttributeAnnotatable, IRegisterable, IRegistered)
@@ -79,8 +86,7 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
 
-        newInteraction(None)
-        getInteraction().add('someuser')
+        newInteraction(ParticipationStub('someuser'))
 
         pd = TestProcessDefinition()
 
@@ -192,8 +198,7 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
 
-        newInteraction(None)
-        getInteraction().add('someuser')
+        newInteraction(ParticipationStub('someuser'))
 
         pd = TestProcessDefinition()
 
@@ -281,8 +286,7 @@
     def setUp(self):
         WorkflowSetup.setUp(self)
 
-        newInteraction(None)
-        getInteraction().add('someuser')
+        newInteraction(ParticipationStub('someuser'))
 
         pd = TestProcessDefinition()
 
@@ -368,8 +372,7 @@
         serviceManager.provideService(Permissions, permissionRegistry)
         permissionRegistry.definePermission('deny', 'Deny')
 
-        newInteraction(None)
-        getInteraction().add('someuser')
+        newInteraction(ParticipationStub('someuser'))
 
         pd = TestProcessDefinition()
 




More information about the Zope3-Checkins mailing list