Back to index

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


Member Function Documentation

Definition at line 761 of file testKSSRegistry.py.

00761 
00762     def afterSetUp(self):
00763         self.tool = getattr(self.portal, KSSTOOLNAME)
00764         self.tool.clearResources()
00765         self.portalpath = '/' + getToolByName(self.portal, "portal_url")(1)
00766         self.toolpath = '/' + self.tool.absolute_url(1)

Definition at line 767 of file testKSSRegistry.py.

00767 
00768     def testDebugModeSplitting(self):
00769         self.tool.registerKineticStylesheet('ham')
00770         self.tool.registerKineticStylesheet('spam')
00771         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)
00772         self.tool.setDebugMode(True)
00773         self.tool.cookResources()
00774         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)

Here is the call graph for this function:

Definition at line 775 of file testKSSRegistry.py.

00775 
00776     def testDebugModeSplitting2(self):
00777         self.tool.registerKineticStylesheet('ham')
00778         # Publish in normal mode
00779         response = self.publish(self.toolpath+'/ham')
00780         now = DateTime()
00781         days = 7
00782         soon = now + days
00783         self.assertEqual(response.getStatus(), 200)
00784         self.assertEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00785         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=%d' % int(days*24*3600))
00786 
00787         # Set debug mode
00788         self.tool.setDebugMode(True)
00789         self.tool.cookResources()
00790         # Publish in debug mode
00791         response = self.publish(self.toolpath+'/ham')
00792         self.failIfEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00793         self.assertEqual(response.getHeader('Expires'), rfc1123_date(now.timeTime()))
00794         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=0')
00795 


Member Data Documentation

Definition at line 764 of file testKSSRegistry.py.

Definition at line 762 of file testKSSRegistry.py.

Definition at line 765 of file testKSSRegistry.py.


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