[Zope3-checkins] CVS: Zope3/src/zope/app/publication/tests - test_browserpublication.py:1.23.2.1 test_zopepublication.py:1.22.2.2

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


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

Modified Files:
      Tag: mgedmin-events2-branch
	test_browserpublication.py test_zopepublication.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/publication/tests/test_browserpublication.py 1.23 => 1.23.2.1 ===
--- Zope3/src/zope/app/publication/tests/test_browserpublication.py:1.23	Fri Feb 20 11:57:27 2004
+++ Zope3/src/zope/app/publication/tests/test_browserpublication.py	Fri Mar 19 13:50:47 2004
@@ -281,7 +281,7 @@
         # With a normal request, we should get a body:
         output = StringIO()
         request = TestRequest(StringIO(''), output, {'PATH_INFO': '/'})
-        request.setUser(User())
+        request.setPrincipal(User())
         request.response.setBody("spam")
         pub.afterCall(request)
         request.response.outputBody()
@@ -297,7 +297,7 @@
         # But with a HEAD request, the body should be empty
         output = StringIO()
         request = TestRequest(StringIO(''), output, {'PATH_INFO': '/'})
-        request.setUser(User())
+        request.setPrincipal(User())
         request.method = 'HEAD'
         request.response.setBody("spam")
         pub.afterCall(request)


=== Zope3/src/zope/app/publication/tests/test_zopepublication.py 1.22.2.1 => 1.22.2.2 ===
--- Zope3/src/zope/app/publication/tests/test_zopepublication.py:1.22.2.1	Mon Mar  8 13:43:38 2004
+++ Zope3/src/zope/app/publication/tests/test_zopepublication.py	Fri Mar 19 13:50:47 2004
@@ -305,20 +305,18 @@
         publication = ZopePublication(self.db)
 
         publication.beforeTraversal(request)
-        user = iter(getInteraction().principals).next()
-        self.assertEqual(user, request.user)
-        self.assertEqual(request.user.getId(), 'anonymous')
+        self.assertEqual(list(getInteraction().participations), [request])
+        self.assertEqual(request.principal.getId(), 'anonymous')
         root = publication.getApplication(request)
         publication.callTraversalHooks(request, root)
-        self.assertEqual(request.user.getId(), 'anonymous')
+        self.assertEqual(request.principal.getId(), 'anonymous')
         ob = publication.traverseName(request, root, 'f1')
         publication.callTraversalHooks(request, ob)
-        self.assertEqual(request.user.getId(), 'test.anonymous')
+        self.assertEqual(request.principal.getId(), 'test.anonymous')
         ob = publication.traverseName(request, ob, 'f2')
         publication.afterTraversal(request, ob)
-        self.assertEqual(request.user.getId(), 'test.bob')
-        user = iter(getInteraction().principals).next()
-        self.assertEqual(user, request.user)
+        self.assertEqual(request.principal.getId(), 'test.bob')
+        self.assertEqual(list(getInteraction().participations), [request])
 
 
 def test_suite():




More information about the Zope3-Checkins mailing list