[CMF-checkins] CVS: CMF/CMFSetup/tests - test_skins.py:1.9.2.4

Florent Guillaume fg at nuxeo.com
Sun Mar 27 12:59:35 EST 2005


Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv15179

Modified Files:
      Tag: CMF-1_5-branch
	test_skins.py 
Log Message:
Fixed tests to call clearCurrentSkin and setupCurrentSkin on the portal
itself, not the skins tool.


=== CMF/CMFSetup/tests/test_skins.py 1.9.2.3 => 1.9.2.4 ===
--- CMF/CMFSetup/tests/test_skins.py:1.9.2.3	Tue Mar 22 14:23:49 2005
+++ CMF/CMFSetup/tests/test_skins.py	Sun Mar 27 12:59:35 2005
@@ -37,9 +37,14 @@
 _TESTS_PATH = os.path.split( __file__ )[ 0 ]
 
 
-class DummySkinsTool( Folder ):
+class DummySite(Folder):
+    _skin_setup_called = False
+    def clearCurrentSkin(self):
+        pass
+    def setupCurrentSkin(self, REQUEST):
+        self._skin_setup_called = True
 
-    _setup_called = False
+class DummySkinsTool( Folder ):
 
     default_skin = 'default_skin'
     request_varname = 'request_varname'
@@ -67,10 +72,6 @@
 
         self._selections[ skinname ] = skinpath
 
-    def setupCurrentSkin( self, REQEUEST ):
-
-        self._setup_called = True
-
 class DummyFSDV( Item ):
 
     meta_type = DirectoryView.DirectoryView.meta_type
@@ -99,7 +100,7 @@
         if fsdvs is None:
             fsdvs = []
 
-        self.root.site = Folder( id='site' )
+        self.root.site = DummySite()
 
         for id, fsdv in fsdvs:
             self._registerDirectoryView( expandpath(fsdv._dirpath) )
@@ -203,7 +204,7 @@
         site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -225,7 +226,7 @@
         self._registerDirectoryView( os.path.join( _TESTS_PATH, 'three' ) )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 0 )
         self.assertEqual( len( skins_tool.objectItems() ), 0 )
 
@@ -346,7 +347,7 @@
         site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -361,7 +362,7 @@
         self.failIf( skins_tool.allow_any )
         self.failIf( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 0 )
         self.assertEqual( len( skins_tool.objectItems() ), 0 )
 
@@ -376,7 +377,7 @@
         site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -391,7 +392,7 @@
         self.failIf( skins_tool.allow_any )
         self.failIf( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 0 )
         self.assertEqual( len( skins_tool.objectItems() ), 0 )
 
@@ -406,7 +407,7 @@
         site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -421,7 +422,7 @@
         self.failIf( skins_tool.allow_any )
         self.failIf( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -433,7 +434,7 @@
         self._registerDirectoryView( os.path.join( _TESTS_PATH, 'three' ) )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 0 )
         self.assertEqual( len( skins_tool.objectItems() ), 0 )
 
@@ -448,7 +449,7 @@
         self.failUnless( skins_tool.allow_any )
         self.failUnless( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -460,7 +461,7 @@
         self._registerDirectoryView( os.path.join( _TESTS_PATH, 'three' ) )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 0 )
         self.assertEqual( len( skins_tool.objectItems() ), 0 )
 
@@ -475,7 +476,7 @@
         self.failUnless( skins_tool.allow_any )
         self.failUnless( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         self.assertEqual( len( skins_tool.getSkinPaths() ), 2 )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
@@ -489,7 +490,7 @@
         self._registerDirectoryView( os.path.join( _TESTS_PATH, 'three' ) )
         skins_tool = site.portal_skins
 
-        self.failIf( skins_tool._setup_called )
+        self.failIf( site._skin_setup_called )
         skin_paths = skins_tool.getSkinPaths()
         self.assertEqual( len( skin_paths ), 2 )
         self.assertEqual( skin_paths[ 0 ], ( 'basic', 'one' ) )
@@ -507,7 +508,7 @@
         self.failIf( skins_tool.allow_any )
         self.failIf( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         skin_paths = skins_tool.getSkinPaths()
         self.assertEqual( len( skin_paths ), 2 )
         self.assertEqual( skin_paths[ 0 ], ( 'basic', 'one,three' ) )
@@ -523,7 +524,7 @@
         self.failIf( skins_tool.allow_any )
         self.failIf( skins_tool.cookie_persistence )
 
-        self.failUnless( skins_tool._setup_called )
+        self.failUnless( site._skin_setup_called )
         skin_paths = skins_tool.getSkinPaths()
         self.assertEqual( len( skin_paths ), 2 )
         self.assertEqual( skin_paths[ 0 ], ( 'basic', 'one,three,four' ) )



More information about the CMF-checkins mailing list