Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testPublishFiveResource

Public Attributes

 tool
 toolpath
 portalpath

Detailed Description

Definition at line 494 of file testJSRegistry.py.


Member Function Documentation

Definition at line 497 of file testJSRegistry.py.

00497 
00498     def afterSetUp(self):
00499         # Define some resource
00500         from Products.Five.zcml import load_config
00501         import Products.ResourceRegistries.tests
00502         load_config('test.zcml', Products.ResourceRegistries.tests)
00503         self.tool = getattr(self.portal, JSTOOLNAME)
00504         self.tool.clearResources()
00505         self.tool.registerScript('++resource++test_rr_1.js')
00506         self.toolpath = '/' + self.tool.absolute_url(1)
00507         self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1)
00508         self.setRoles(['Manager'])
00509         self.portal.invokeFactory('Document', 'index_html')
00510         self.setRoles(['Member'])

Definition at line 511 of file testJSRegistry.py.

00511 
00512     def testPublishFiveResource(self):
00513         response = self.publish(self.toolpath + '/++resource++test_rr_1.js')
00514         self.assertEqual(response.getStatus(), 200)
00515         self.assertEqual(response.getHeader('Content-Type')[:24], 'application/x-javascript')
00516         self.assertEqual("window.alert('running')" in response.getBody(), True)


Member Data Documentation

Definition at line 506 of file testJSRegistry.py.

Definition at line 502 of file testJSRegistry.py.

Definition at line 505 of file testJSRegistry.py.


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