Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
ResourceRegistries.tests.testKSSRegistry.TestSkinAwareness Class Reference
Inheritance diagram for ResourceRegistries.tests.testKSSRegistry.TestSkinAwareness:
Inheritance graph
[legend]
Collaboration diagram for ResourceRegistries.tests.testKSSRegistry.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 843 of file testKSSRegistry.py.


Member Function Documentation

Definition at line 845 of file testKSSRegistry.py.

00845 
00846     def afterSetUp(self):
00847         self.tool = getattr(self.portal, KSSTOOLNAME)
00848         self.skinstool = getattr(self.portal, 'portal_skins')
00849         self.tool.clearResources()
00850         self.portalpath = '/' + getToolByName(self.portal, "portal_url")(1)
00851         self.toolpath = '/' + self.tool.absolute_url(1)
00852         self.setRoles(['Manager'])
00853         self.skinstool.manage_addFolder(id='pink')
00854         self.skinstool.manage_addFolder(id='purple')
00855         self.skinstool.pink.manage_addFile(id='skin.kss',
00856                                    content_type='text/css',
00857                                    file='body { background-color : pink }')
00858         self.skinstool.purple.manage_addFile(id='skin.kss',
00859                                     content_type='text/css',
00860                                     file='body { background-color : purple }')
00861         self.tool.registerKineticStylesheet('skin.kss')
00862         self.skinstool.addSkinSelection('PinkSkin', 'pink,ResourceRegistries')
00863         self.skinstool.addSkinSelection('PurpleSkin', 'purple,ResourceRegistries')
00864         self.setRoles(['Member'])
        

Definition at line 881 of file testKSSRegistry.py.

00881 
00882     def testPublishWithSkin(self):
00883         response = self.publish(self.toolpath + '/PinkSkin/skin.kss')
00884         self.assertEqual(response.getStatus(), 200)
00885         self.failUnless('pink' in str(response))
00886         response = self.publish(self.toolpath + '/PurpleSkin/skin.kss')
00887         self.assertEqual(response.getStatus(), 200)
00888         self.failUnless('purple' in str(response))
00889 

Definition at line 865 of file testKSSRegistry.py.

00865 
00866     def testRenderIncludesSkinInPath(self):
00867         self.portal.changeSkin('PinkSkin', REQUEST=self.portal.REQUEST)
00868         view = self.portal.restrictedTraverse('@@plone')
00869         viewletmanager = getMultiAdapter((self.portal, self.portal.REQUEST, view), IContentProvider, name = u'plone.resourceregistries.styles')
00870         viewletmanager.update()
00871         content = viewletmanager.render()
00872         self.failUnless('/PinkSkin/' in content)
00873         self.failIf('/PurpleSkin/' in content)
00874         self.portal.changeSkin('PurpleSkin', REQUEST=self.portal.REQUEST)
00875         view = self.portal.restrictedTraverse('@@plone')
00876         viewletmanager = getMultiAdapter((self.portal, self.portal.REQUEST, view), IContentProvider, name = u'plone.resourceregistries.styles')
00877         viewletmanager.update()
00878         content = viewletmanager.render()
00879         self.failUnless('/PurpleSkin/' in content)
00880         self.failIf('/PinkSkin/' in content)

Here is the call graph for this function:


Member Data Documentation

Definition at line 849 of file testKSSRegistry.py.

Definition at line 847 of file testKSSRegistry.py.

Definition at line 846 of file testKSSRegistry.py.

Definition at line 850 of file testKSSRegistry.py.


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