[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/tests - testZopePublication.py:1.1.2.7

Andreas Jung andreas@digicool.com
Thu, 10 Jan 2002 15:02:25 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/tests
In directory cvs.zope.org:/tmp/cvs-serv24951/Zope/App/ZopePublication/tests

Modified Files:
      Tag: Zope-3x-branch
	testZopePublication.py 
Log Message:
added logic to check for skins specifications anywhere inside the URL


=== Zope3/lib/python/Zope/App/ZopePublication/tests/testZopePublication.py 1.1.2.6 => 1.1.2.7 ===
         if name == 'bruce':
             return self.__class__()
+        if name == 'edit;view':
+            return 'bob'
         raise KeyError, name
 
     def browser_default(self, request):
@@ -66,7 +68,9 @@
     klass = ZopePublication
 
 class BrowserPublicationTests(BasePublicationTests):
+
     klass = BrowserPublication
+
     def testNativeTraverseNameWrapping(self):
         pub = self.klass(self.db)
         ob = DummyPublished()
@@ -130,6 +134,21 @@
         self.failUnless(type(ob2) is Wrapper)
         unw = getobject(ob2)
         self.assertEqual(unw, 'bruce')
+
+
+    def testTraverseSkinExtraction(self):
+        pub = self.klass(self.db)
+        ob = DummyPublished()
+        r = self._createRequest('/edit;skin=zmi;view',pub)
+        ob2 = pub.traverseName(r , ob, 'edit;skin=zmi;view')
+        self.assertEqual( r.getViewSkin(), 'zmi')
+        self.assertEqual( ob2 , 'bob')
+
+        r = self._createRequest('/edit;view;skin=zmi',pub)
+        ob2 = pub.traverseName(r , ob, 'edit;view;skin=zmi')
+        self.assertEqual( r.getViewSkin(), 'zmi')
+        self.assertEqual( ob2 , 'bob')
+
 
 def test_suite():
     t1 = unittest.makeSuite(ZopePublicationTests, 'test')