Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_SkinsTool.SkinnableTests Class Reference

List of all members.

Public Member Functions

def tearDown
def test_getCurrentSkinName

Private Member Functions

def _makeOne

Detailed Description

Definition at line 95 of file test_SkinsTool.py.


Member Function Documentation

Definition at line 97 of file test_SkinsTool.py.

00097 
00098     def _makeOne(self):
00099         from Products.CMFCore.SkinsTool import SkinsTool
00100         from Products.CMFCore.Skinnable import SkinnableObjectManager
00101 
00102         class TestSkinnableObjectManager(SkinnableObjectManager):
00103             tool = SkinsTool()
00104             # This is needed otherwise REQUEST is the string
00105             # '<Special Object Used to Force Acquisition>'
00106             REQUEST = None
00107             def getSkinsFolderName(self):
00108                 '''tool'''
00109                 return 'tool'
00110 
00111         return TestSkinnableObjectManager()

Definition at line 112 of file test_SkinsTool.py.

00112 
00113     def tearDown(self):
00114         from Products.CMFCore.Skinnable import SKINDATA
00115         SKINDATA.clear()
00116         cleanUp()

Here is the call graph for this function:

Definition at line 117 of file test_SkinsTool.py.

00117 
00118     def test_getCurrentSkinName(self):
00119         som = self._makeOne()
00120 
00121         pathA = ('foo, bar')
00122         pathB = ('bar, foo')
00123 
00124         som.tool.addSkinSelection('skinA', pathA)
00125         som.tool.addSkinSelection('skinB', pathB)
00126 
00127         som.tool.manage_properties(default_skin='skinA')
00128 
00129         # Expect the default skin name to be returned
00130         self.failUnless(som.getCurrentSkinName() == 'skinA')
00131 
00132         # after a changeSkin the new skin name should be returned
00133         som.changeSkin('skinB', som.REQUEST)
00134         self.failUnless(som.getCurrentSkinName() == 'skinB')
00135 

Here is the call graph for this function:


The documentation for this class was generated from the following file: