Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testGetOriginal

Public Attributes

 tool

Detailed Description

Definition at line 868 of file testJSRegistry.py.


Member Function Documentation

Definition at line 870 of file testJSRegistry.py.

00870 
00871     def afterSetUp(self):
00872         from Products.Five.zcml import load_config
00873         import Products.ResourceRegistries.tests
00874         load_config('test.zcml', Products.ResourceRegistries.tests)
00875         self.tool = getattr(self.portal, JSTOOLNAME)
00876         self.tool.clearResources()
00877         body = "/* add a comment with unicode\n   \xc3\x9bercool! */\nwindow.alert('running')\n"
00878         self.setRoles(['Manager'])
00879         self.portal.addDTMLMethod('testmethod.js', file=body)
00880         self.portal.invokeFactory('File',
00881                                    id='testfile.js',
00882                                    format='application/x-javascript',
00883                                    content_type='application/x-javascript;charset=utf-8',
00884                                    file=body)
00885         self.setRoles(['Member'])

Definition at line 886 of file testJSRegistry.py.

00886 
00887     def testGetOriginal(self):
00888         # this needs to be first because it's a zpt returning unicode
00889         self.tool.registerScript('test_rr_1.js')
00890         self.tool.registerScript('++resource++test_rr_1.js')
00891         self.tool.registerScript('test_rr_2.js')
00892         self.tool.registerScript('test_rr_3.js')
00893         self.tool.registerScript('testmethod.js')
00894         self.tool.registerScript('testfile.js')
00895         scripts = self.tool.getEvaluatedResources(self.portal)
00896         magicId = None
00897         for script in scripts:
00898             id = script.getId()
00899             if '-cachekey' in id:
00900                 magicId = id
00901         self.failUnless(magicId)
00902         content = self.tool.getResourceContent(magicId, self.portal, original=True)
00903 

Here is the call graph for this function:


Member Data Documentation

Definition at line 874 of file testJSRegistry.py.


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