Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testGetItemTraversal
def testGetItemTraversalContent
def testRestrictedTraverseContent
def testRestrictedTraverseComposition
def testCompositesWithBrokedId
def testMediadescriptorsInConcatenatedStylesheets

Public Attributes

 tool

Detailed Description

Definition at line 485 of file testCSSRegistry.py.


Member Function Documentation

Definition at line 487 of file testCSSRegistry.py.

00487 
00488     def afterSetUp(self):
00489         self.tool = getattr(self.portal, CSSTOOLNAME)
00490         self.tool.clearResources()
00491         self.tool.registerStylesheet('test_rr_1.css')

Definition at line 511 of file testCSSRegistry.py.

00511 
00512     def testCompositesWithBrokedId(self):
00513         self.tool.registerStylesheet('nonexistant.css')
00514         stylesheets = self.tool.getEvaluatedResources(self.portal)
00515         self.assertEqual(len(stylesheets), 1)
00516         magicId = stylesheets[0].getId()
00517         content = str(self.portal.restrictedTraverse('portal_css/%s' % magicId))

Here is the call graph for this function:

Definition at line 492 of file testCSSRegistry.py.

00492 
00493     def testGetItemTraversal(self):
00494         self.failUnless(self.tool['test_rr_1.css'])

Definition at line 495 of file testCSSRegistry.py.

00495 
00496     def testGetItemTraversalContent(self):
00497         self.failUnless('background-color' in str(self.tool['test_rr_1.css']))

Definition at line 518 of file testCSSRegistry.py.

00518 
00519     def testMediadescriptorsInConcatenatedStylesheets(self):
00520         self.tool.registerStylesheet('test_rr_2.css', media='print')
00521         styles = self.tool.getEvaluatedResources(self.portal)
00522         self.assertEqual(len(styles), 1)
00523         magicId = styles[0].getId()
00524         content = str(self.portal.restrictedTraverse('portal_css/%s' % magicId))
00525         self.failUnless('@media print' in content)
00526         self.failUnless('background-color : red' in content)
00527         self.failUnless('H1 { color: blue; }' in content)

Here is the call graph for this function:

Definition at line 502 of file testCSSRegistry.py.

00502 
00503     def testRestrictedTraverseComposition(self):
00504         self.tool.registerStylesheet('test_rr_2.css')
00505         styles = self.tool.getEvaluatedResources(self.portal)
00506         self.assertEqual(len(styles), 1)
00507         magicId = styles[0].getId()
00508         content = str(self.portal.restrictedTraverse('portal_css/%s' % magicId))
00509         self.failUnless('background-color' in content)
00510         self.failUnless('blue' in content)

Here is the call graph for this function:

Definition at line 498 of file testCSSRegistry.py.

00498 
00499     def testRestrictedTraverseContent(self):
00500         self.failUnless('background-color' in str(
00501                         self.portal.restrictedTraverse('portal_css/test_rr_1.css')))


Member Data Documentation

Definition at line 488 of file testCSSRegistry.py.


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