[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests - test_skin.py:1.5

Jim Fulton jim at zope.com
Fri Aug 8 15:07:55 EDT 2003


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

Modified Files:
	test_skin.py 
Log Message:
Simplified the test to use a faux request.


=== Zope3/src/zope/app/traversing/tests/test_skin.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/traversing/tests/test_skin.py:1.4	Thu May  1 15:35:38 2003
+++ Zope3/src/zope/app/traversing/tests/test_skin.py	Fri Aug  8 14:07:50 2003
@@ -18,20 +18,25 @@
 """
 
 from unittest import TestCase, main, makeSuite
-from zope.testing.cleanup import CleanUp # Base class w registry cleanup
-from zope.publisher.browser import TestRequest
 
-class Test(CleanUp, TestCase):
+class Test(TestCase):
 
     def test(self):
         from zope.app.traversing.namespace import skin
 
-        request = TestRequest()
-        self.assertEqual(request.getPresentationSkin(), '')
+        class FauxRequest:
+            def shiftNameToApplication(self):
+                self.shifted = 1
+            skin = ''
+            def setPresentationSkin(self, skin):
+                self.skin = skin
+
+        request = FauxRequest()
         ob = object()
         ob2 = skin('foo', (), '++skin++foo', ob, request)
         self.assertEqual(ob, ob2)
-        self.assertEqual(request.getPresentationSkin(), 'foo')
+        self.assertEqual(request.skin, 'foo')
+        self.assertEqual(request.shifted, 1)
 
 def test_suite():
     return makeSuite(Test)




More information about the Zope3-Checkins mailing list