[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser/tests - test_globalbrowsermenuservice.py:1.15.16.2

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


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

Modified Files:
      Tag: mgedmin-events2-branch
	test_globalbrowsermenuservice.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/publisher/browser/tests/test_globalbrowsermenuservice.py 1.15.16.1 => 1.15.16.2 ===
--- Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservice.py:1.15.16.1	Mon Mar  8 13:43:39 2004
+++ Zope3/src/zope/app/publisher/browser/tests/test_globalbrowsermenuservice.py	Fri Mar 19 13:50:49 2004
@@ -31,6 +31,14 @@
 from zope.security.management import system_user
 from zope.app import zapi
 
+
+class ParticipationStub:
+
+    def __init__(self, principal):
+        self.principal = principal
+        self.interaction = None
+
+
 class I1(Interface): pass
 class I11(I1): pass
 class I12(I1): pass
@@ -105,17 +113,16 @@
         r.menuItem('test_id', I111, 'u8', 't8', 'd8')
         r.menuItem('test_id', I12, 'a9', 't9', 'd9')
 
-        newInteraction(None)
+        newInteraction()
 
         menu = r.getMenu('test_id', TestObject(), TestRequest())
 
         self.assertEqual(list(menu), [d(6), d(3), d(2), d(1)])
 
-        getInteraction().add(system_user)
+        getInteraction().add(ParticipationStub(system_user))
 
         menu = r.getMenu('test_id', TestObject(), TestRequest())
         self.assertEqual(list(menu), [d(5), d(6), d(3), d(2), d(1)])
-        
 
     def test_no_dups(self):
         r = self.__reg()




More information about the Zope3-Checkins mailing list