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

Jens Vagelpohl jens at dataflake.org
Tue Mar 22 14:26:10 EST 2005


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

Modified Files:
	test_skins.py 
Log Message:
- CMFSetup: When importing skins configurations you can now specify a
  layer to be inserted after a given layer. Previously you could only
  insert before a given layer.


=== CMF/CMFSetup/tests/test_skins.py 1.11 => 1.12 ===
--- CMF/CMFSetup/tests/test_skins.py:1.11	Fri Mar 11 07:23:52 2005
+++ CMF/CMFSetup/tests/test_skins.py	Tue Mar 22 14:25:40 2005
@@ -280,6 +280,17 @@
 </skins-tool>
 """
 
+_FRAGMENT_IMPORT2 = """\
+<?xml version="1.0"?>
+<skins-tool>
+ <skin-directory id="four" directory="CMFSetup/tests/four" />
+ <skin-path id="*">
+  <layer name="four" insert-after="three"/>
+ </skin-path>
+</skins-tool>
+"""
+
+
 class Test_exportSkinsTool( _SkinsSetup ):
 
     def test_empty( self ):
@@ -503,6 +514,21 @@
         self.assertEqual( skin_paths[ 1 ], ( 'fancy', 'three,two,one' ) )
         self.assertEqual( len( skins_tool.objectItems() ), 3 )
 
+        self._registerDirectoryView( os.path.join( _TESTS_PATH, 'four' ) )
+        context._files[ 'skins.xml' ] = _FRAGMENT_IMPORT2
+        importSkinsTool( context )
+
+        self.assertEqual( skins_tool.default_skin, "default_skin" )
+        self.assertEqual( skins_tool.request_varname, "request_varname" )
+        self.failIf( skins_tool.allow_any )
+        self.failIf( skins_tool.cookie_persistence )
+
+        self.failUnless( skins_tool._setup_called )
+        skin_paths = skins_tool.getSkinPaths()
+        self.assertEqual( len( skin_paths ), 2 )
+        self.assertEqual( skin_paths[ 0 ], ( 'basic', 'one,three,four' ) )
+        self.assertEqual( skin_paths[ 1 ], ( 'fancy', 'three,four,two,one' ) )
+        self.assertEqual( len( skins_tool.objectItems() ), 4 )
 
 def test_suite():
     return unittest.TestSuite((



More information about the CMF-checkins mailing list