Back to index

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


Member Function Documentation

Definition at line 519 of file testJSRegistry.py.

00519 
00520     def afterSetUp(self):
00521         self.tool = getattr(self.portal, JSTOOLNAME)
00522         self.tool.clearResources()
00523         self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1)
00524         self.toolpath = '/' + self.tool.absolute_url(1)

Definition at line 525 of file testJSRegistry.py.

00525 
00526     def testDebugModeSplitting(self):
00527         self.tool.registerScript('ham')
00528         self.tool.registerScript('spam')
00529         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 1)
00530         self.tool.setDebugMode(True)
00531         self.tool.cookResources()
00532         self.assertEqual(len(self.tool.getEvaluatedResources(self.folder)), 2)

Here is the call graph for this function:

Definition at line 533 of file testJSRegistry.py.

00533 
00534     def testDebugModeSplitting2(self):
00535         self.tool.registerScript('ham')
00536         # Publish in normal mode
00537         response = self.publish(self.toolpath+'/ham')
00538         now = DateTime()
00539         days = 7
00540         soon = now + days
00541         self.assertEqual(response.getStatus(), 200)
00542         self.assertEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00543         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=%d' % int(days*24*3600))
00544 
00545         # Set debug mode
00546         self.tool.setDebugMode(True)
00547         self.tool.cookResources()
00548         # Publish in debug mode
00549         response = self.publish(self.toolpath+'/ham')
00550         self.failIfEqual(response.getHeader('Expires'), rfc1123_date(soon.timeTime()))
00551         self.assertEqual(response.getHeader('Expires'), rfc1123_date(now.timeTime()))
00552         self.assertEqual(response.getHeader('Cache-Control'), 'max-age=0')
00553 


Member Data Documentation

Definition at line 522 of file testJSRegistry.py.

Definition at line 520 of file testJSRegistry.py.

Definition at line 523 of file testJSRegistry.py.


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