Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testGetItemTraversal
def testGetItemTraversalContent
def testRestrictedTraverseContent
def testRestrictedTraverseComposition

Public Attributes

 tool

Detailed Description

Definition at line 440 of file testKSSRegistry.py.


Member Function Documentation

Definition at line 442 of file testKSSRegistry.py.

00442 
00443     def afterSetUp(self):
00444         self.tool = getattr(self.portal, KSSTOOLNAME)
00445         self.tool.clearResources()
00446         self.setRoles(['Manager'])
00447         self.portal.invokeFactory('File',
00448                                    id='testroot.kss',
00449                                    format='text/css',
00450                                    content_type='text/css',
00451                                    file='body { background-color : red }')
00452         self.portal.invokeFactory('Folder', 'subfolder')
00453         self.portal.subfolder.invokeFactory('File',
00454                                    id='testsubfolder.kss',
00455                                    format='text/css',
00456                                    content_type='text/css',
00457                                    file='body { background-color : blue }')
00458 
00459         self.tool.registerKineticStylesheet('testroot.kss')
00460         self.tool.registerKineticStylesheet('subfolder/testsubfolder.kss')
00461         self.setRoles(['Member'])

Definition at line 462 of file testKSSRegistry.py.

00462 
00463     def testGetItemTraversal(self):
00464         self.failUnless(self.tool['testroot.kss'])
00465         self.failUnless(self.tool['subfolder/testsubfolder.kss'])

Definition at line 466 of file testKSSRegistry.py.

00466 
00467     def testGetItemTraversalContent(self):
00468         self.failUnless('red' in str(self.tool['testroot.kss']))
00469         self.failUnless('blue' in str(self.tool['subfolder/testsubfolder.kss']))
00470         self.failIf('blue' in str(self.tool['testroot.kss']))
00471         self.failIf('red' in str(self.tool['subfolder/testsubfolder.kss']))
00472 

Definition at line 483 of file testKSSRegistry.py.

00483 
00484     def testRestrictedTraverseComposition(self):
00485         styles = self.tool.getEvaluatedResources(self.portal)
00486         self.assertEqual(len(styles), 1)
00487         magicId = styles[0].getId()
00488         content = str(self.portal.restrictedTraverse('portal_kss/%s' % magicId))
00489         self.failUnless('background-color' in content)
00490         self.failUnless('red' in content)
00491         self.failUnless('blue' in content)
00492 

Here is the call graph for this function:

Definition at line 473 of file testKSSRegistry.py.

00473 
00474     def testRestrictedTraverseContent(self):
00475         self.failUnless('red' in str(
00476                         self.portal.restrictedTraverse('portal_kss/testroot.kss')))
00477         self.failUnless('blue' in str(
00478                         self.portal.restrictedTraverse('portal_kss/subfolder/testsubfolder.kss')))
00479         self.failIf('blue' in str(
00480                         self.portal.restrictedTraverse('portal_kss/testroot.kss')))
00481         self.failIf('red' in str(
00482                         self.portal.restrictedTraverse('portal_kss/subfolder/testsubfolder.kss')))


Member Data Documentation

Definition at line 443 of file testKSSRegistry.py.


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