Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
ResourceRegistries.tests.testCSSRegistry.TestSkinAwareness Class Reference
Inheritance diagram for ResourceRegistries.tests.testCSSRegistry.TestSkinAwareness:
Inheritance graph
[legend]
Collaboration diagram for ResourceRegistries.tests.testCSSRegistry.TestSkinAwareness:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testRenderIncludesSkinInPath
def testPublishWithSkin

Public Attributes

 tool
 skinstool
 portalpath
 toolpath

Detailed Description

Definition at line 975 of file testCSSRegistry.py.


Member Function Documentation

Definition at line 977 of file testCSSRegistry.py.

00977 
00978     def afterSetUp(self):
00979         self.tool = getattr(self.portal, CSSTOOLNAME)
00980         self.skinstool = getattr(self.portal, 'portal_skins')
00981         self.tool.clearResources()
00982         self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1)
00983         self.toolpath = '/' + self.tool.absolute_url(1)
00984         self.setRoles(['Manager'])
00985         self.skinstool.manage_addFolder(id='pink')
00986         self.skinstool.manage_addFolder(id='purple')
00987         self.skinstool.pink.manage_addFile(id='skin.css',
00988                                    content_type='text/css',
00989                                    file='body { background-color : pink }')
00990         self.skinstool.purple.manage_addFile(id='skin.css',
00991                                     content_type='text/css',
00992                                     file='body { background-color : purple }')
00993         self.tool.registerStylesheet('skin.css')
00994         self.skinstool.addSkinSelection('PinkSkin', 'pink,ResourceRegistries')
00995         self.skinstool.addSkinSelection('PurpleSkin', 'purple,ResourceRegistries')
00996         self.setRoles(['Member'])
        

Definition at line 1013 of file testCSSRegistry.py.

01013 
01014     def testPublishWithSkin(self):
01015         response = self.publish(self.toolpath + '/PinkSkin/skin.css')
01016         self.assertEqual(response.getStatus(), 200)
01017         self.failUnless('pink' in str(response))
01018         response = self.publish(self.toolpath + '/PurpleSkin/skin.css')
01019         self.assertEqual(response.getStatus(), 200)
01020         self.failUnless('purple' in str(response))
01021 

Definition at line 997 of file testCSSRegistry.py.

00997 
00998     def testRenderIncludesSkinInPath(self):
00999         self.portal.changeSkin('PinkSkin', REQUEST=self.portal.REQUEST)
01000         view = self.portal.restrictedTraverse('@@plone')
01001         viewletmanager = getMultiAdapter((self.portal, self.portal.REQUEST, view), IContentProvider, name = u'plone.resourceregistries.styles')
01002         viewletmanager.update()
01003         content = viewletmanager.render()
01004         self.failUnless('/PinkSkin/' in content)
01005         self.failIf('/PurpleSkin/' in content)
01006         self.portal.changeSkin('PurpleSkin', REQUEST=self.portal.REQUEST)
01007         view = self.portal.restrictedTraverse('@@plone')
01008         viewletmanager = getMultiAdapter((self.portal, self.portal.REQUEST, view), IContentProvider, name = u'plone.resourceregistries.styles')
01009         viewletmanager.update()
01010         content = viewletmanager.render()
01011         self.failUnless('/PurpleSkin/' in content)
01012         self.failIf('/PinkSkin/' in content)

Here is the call graph for this function:


Member Data Documentation

Definition at line 981 of file testCSSRegistry.py.

Definition at line 979 of file testCSSRegistry.py.

Definition at line 978 of file testCSSRegistry.py.

Definition at line 982 of file testCSSRegistry.py.


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