Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testDebugModeSplitting
def testDebugModeSplitting2

Public Attributes

 tool
 portalpath
 toolpath

Detailed Description

Definition at line 891 of file testCSSRegistry.py.


Member Function Documentation

Definition at line 893 of file testCSSRegistry.py.

00893 
00894     def afterSetUp(self):
00895         self.tool = getattr(self.portal, CSSTOOLNAME)
00896         self.tool.clearResources()
00897         self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1)
00898         self.toolpath = '/' + self.tool.absolute_url(1)

Definition at line 899 of file testCSSRegistry.py.

00899 
00900     def testDebugModeSplitting(self):
00901         self.tool.registerStylesheet('ham')
00902         self.tool.registerStylesheet('spam')
00903         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)
00904         self.tool.setDebugMode(True)
00905         self.tool.cookResources()
00906         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)

Here is the call graph for this function:

Definition at line 907 of file testCSSRegistry.py.

00907 
00908     def testDebugModeSplitting2(self):
00909         self.tool.registerStylesheet('ham')
00910         # Publish in normal mode
00911         response = self.publish(self.toolpath+'/ham')
00912         now = DateTime()
00913         days = 7
00914         soon = now + days
00915         self.assertEqual(response.getStatus(), 200)
00916         self.assertEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00917         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=%d' % int(days*24*3600))
00918 
00919         # Set debug mode
00920         self.tool.setDebugMode(True)
00921         self.tool.cookResources()
00922         # Publish in debug mode
00923         response = self.publish(self.toolpath+'/ham')
00924         self.failIfEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00925         self.assertEqual(response.getHeader('Expires'), rfc1123_date(now.timeTime()))
00926         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=0')
00927 


Member Data Documentation

Definition at line 896 of file testCSSRegistry.py.

Definition at line 894 of file testCSSRegistry.py.

Definition at line 897 of file testCSSRegistry.py.


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