[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_pagefolder.py:1.7.18.2

Fred L. Drake, Jr. fred at zope.com
Mon Sep 8 18:56:40 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	test_pagefolder.py 
Log Message:
Fix a couple more tests, and make them pass as well.

=== Zope3/src/zope/app/services/tests/test_pagefolder.py 1.7.18.1 => 1.7.18.2 ===
--- Zope3/src/zope/app/services/tests/test_pagefolder.py:1.7.18.1	Mon Sep  8 14:21:49 2003
+++ Zope3/src/zope/app/services/tests/test_pagefolder.py	Mon Sep  8 17:56:39 2003
@@ -43,8 +43,8 @@
         sm = PlacefulSetup.setUp(self, site=True)
         setup.addService(sm, 'Views', ViewService(), suffix='service')
         default = traverse(self.rootFolder, '++etc++site/default')
-        default.setObject('Views', PageFolder())
-        views = traverse(default, 'Views')
+        name = default.setObject('Views', PageFolder())
+        views = traverse(default, name)
         views.forInterface = I
         views.factoryName = None
         views.permission = 'zope.View'
@@ -57,7 +57,9 @@
 
         views.setObject('foo.html', ZPTTemplate())
 
-        registration = traverse(views.getRegistrationManager(), '1')
+        rm = views.getRegistrationManager()
+        name = rm.keys()[-1]
+        registration = traverse(views.getRegistrationManager(), name)
         self.assertEqual(registration.status, ActiveStatus)
         self.assertEqual(registration.forInterface, I)
         self.assertEqual(registration.presentationType, IBrowserPresentation)
@@ -76,7 +78,9 @@
 
         views.setObject('foo.html', ZPTTemplate())
 
-        registration = traverse(views.getRegistrationManager(), '1')
+        rm = views.getRegistrationManager()
+        name = rm.keys()[-1]
+        registration = traverse(views.getRegistrationManager(), name)
         self.assertEqual(registration.status, ActiveStatus)
         self.assertEqual(registration.forInterface, I)
         self.assertEqual(registration.presentationType, IBrowserPresentation)
@@ -89,10 +93,10 @@
         views.forInterface = I2
         views.permission = 'zope.ManageContent'
         views.layer = 'debug'
-    
+
         views.applyDefaults()
 
-        registration = traverse(views.getRegistrationManager(), '1')
+        registration = traverse(views.getRegistrationManager(), name)
         self.assertEqual(registration.status, ActiveStatus)
         self.assertEqual(registration.forInterface, I2)
         self.assertEqual(registration.presentationType, IBrowserPresentation)




More information about the Zope3-Checkins mailing list