Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testPublishCSSThroughTool
def testPublishNonMagicCSSThroughTool
def testPublishPageWithInlineCSS

Public Attributes

 tool
 toolpath
 portalpath

Detailed Description

Definition at line 741 of file testCSSRegistry.py.


Member Function Documentation

Definition at line 743 of file testCSSRegistry.py.

00743 
00744     def afterSetUp(self):
00745         self.tool = getattr(self.portal, CSSTOOLNAME)
00746         self.tool.clearResources()
00747         self.tool.registerStylesheet('plone_styles.css')
00748         self.toolpath = '/' + self.tool.absolute_url(1)
00749         self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1)
00750         self.setRoles(['Manager'])
00751         self.portal.invokeFactory('Document', 'index_html')
00752         self.setRoles(['Member'])

Definition at line 753 of file testCSSRegistry.py.

00753 
00754     def testPublishCSSThroughTool(self):
00755         response = self.publish(self.toolpath + '/plone_styles.css')
00756         self.assertEqual(response.getStatus(), 200)
00757         self.assertEqual(response.getHeader('Content-Type'), 'text/css;charset=utf-8')

Definition at line 758 of file testCSSRegistry.py.

00758 
00759     def testPublishNonMagicCSSThroughTool(self):
00760         self.setRoles(['Manager'])
00761         body = """<dtml-var "'joined' + 'string'">"""
00762         self.portal.addDTMLMethod('testmethod', file=body)
00763         self.tool.registerStylesheet('testmethod')
00764         response = self.publish(self.toolpath + '/testmethod')
00765         self.assertEqual(response.getStatus(), 200)
00766         self.assertEqual(response.getHeader('Content-Type'), 'text/css;charset=utf-8')

Here is the call graph for this function:

Definition at line 767 of file testCSSRegistry.py.

00767 
00768     def testPublishPageWithInlineCSS(self):
00769         response = self.publish(self.portalpath)
00770         self.assertEqual(response.getStatus(), 200)
00771         self.assertEqual(response.getHeader('Content-Type'),
00772                          'text/html;charset=utf-8')
00773         self.tool.clearResources()
00774         # Test that the main page retains its content-type
00775         self.setRoles(['Manager'])
00776         body = """<dtml-call "REQUEST.RESPONSE.setHeader('Content-Type', 'text/css')">/*and some css comments too*/"""
00777         self.portal.addDTMLMethod('testmethod', file=body)
00778         self.tool.registerStylesheet('testmethod', rendering='inline')
00779         response = self.publish(self.portalpath)
00780         self.assertEqual(response.getHeader('Content-Type'), 'text/html;charset=utf-8')
00781         self.assertEqual(response.getStatus(), 200)
00782 

Here is the call graph for this function:


Member Data Documentation

Definition at line 748 of file testCSSRegistry.py.

Definition at line 744 of file testCSSRegistry.py.

Definition at line 747 of file testCSSRegistry.py.


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