[Zope3-checkins] CVS: Zope3/src/zope/app/schema/tests - test_fieldfactory.py:1.3.18.2

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


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

Modified Files:
      Tag: mgedmin-events2-branch
	test_fieldfactory.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/schema/tests/test_fieldfactory.py 1.3.18.1 => 1.3.18.2 ===
--- Zope3/src/zope/app/schema/tests/test_fieldfactory.py:1.3.18.1	Mon Mar  8 13:43:40 2004
+++ Zope3/src/zope/app/schema/tests/test_fieldfactory.py	Fri Mar 19 13:50:49 2004
@@ -22,22 +22,28 @@
 
 from zope.component.exceptions import ComponentLookupError
 from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.security.management import system_user
-from zope.security.management import newInteraction, getInteraction
+from zope.security.management import newInteraction, system_user
 from zope.component import getService
 from zope.app.services.servicenames import Factories
 from zope.schema.interfaces import IField, IText
 from zope.interface import Interface
 from zope.configuration import xmlconfig
 
+
+class ParticipationStub:
+
+    def __init__(self, principal):
+        self.principal = principal
+        self.interaction = None
+
+
 class IFoo(Interface): pass
 
 class TestFieldFactory(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
         super(TestFieldFactory, self).setUp()
-        newInteraction(None)
-        getInteraction().add(system_user)
+        newInteraction(ParticipationStub(system_user))
         context = xmlconfig.file('tests/test_fieldfactory.zcml',
                                  zope.app.schema)
 




More information about the Zope3-Checkins mailing list