Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFCore.tests.test_FSSTXMethod.FSSTXMethodCustomizationTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSSTXMethod.FSSTXMethodCustomizationTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSSTXMethod.FSSTXMethodCustomizationTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test_customize_alternate_root
def test_customize_fspath_as_dot
def test_customize_manual_clone
def test_customize_with_DTML
def test_customize_with_ZPT
def test_customize_caching

Public Attributes

 skins
 custom
 fsdir
 fsSTX

Detailed Description

Definition at line 184 of file test_FSSTXMethod.py.


Member Function Documentation

Reimplemented from CMFCore.tests.test_FSSTXMethod._TemplateSwitcher.

Definition at line 186 of file test_FSSTXMethod.py.

00186 
00187     def setUp(self):
00188         from OFS.Folder import Folder
00189 
00190         _TemplateSwitcher.setUp(self)
00191         SecurityTest.setUp(self)
00192         FSSTXMaker.setUp(self)
00193 
00194         self.root._setObject( 'portal_skins', Folder( 'portal_skins' ) )
00195         self.skins = self.root.portal_skins
00196 
00197         self.skins._setObject( 'custom', Folder( 'custom' ) )
00198         self.custom = self.skins.custom
00199 
00200         self.skins._setObject( 'fsdir', Folder( 'fsdir' ) )
00201         self.fsdir = self.skins.fsdir
00202 
00203         self.fsdir._setObject( 'testSTX'
00204                              , self._makeOne( 'testSTX', 'testSTX.stx' ) )
00205 
00206         self.fsSTX = self.fsdir.testSTX

Reimplemented from CMFCore.tests.test_FSSTXMethod._TemplateSwitcher.

Definition at line 207 of file test_FSSTXMethod.py.

00207 
00208     def tearDown(self):
00209         cleanUp()
00210         FSSTXMaker.tearDown(self)
00211         SecurityTest.tearDown(self)
00212         _TemplateSwitcher.tearDown(self)

Here is the call graph for this function:

Definition at line 213 of file test_FSSTXMethod.py.

00213 
00214     def test_customize_alternate_root( self ):
00215         from OFS.Folder import Folder
00216 
00217         self._setWhichTemplate('DTML')
00218         self.root.other = Folder('other')
00219 
00220         self.fsSTX.manage_doCustomize(folder_path='other', root=self.root)
00221 
00222         self.failIf('testSTX' in self.custom.objectIds())
00223         self.failUnless('testSTX' in self.root.other.objectIds())

Here is the call graph for this function:

Definition at line 286 of file test_FSSTXMethod.py.

00286 
00287     def test_customize_caching(self):
00288         # Test to ensure that cache manager associations survive customizing
00289         from Products.StandardCacheManagers import RAMCacheManager
00290         cache_id = 'gofast'
00291         self._setWhichTemplate('ZPT')
00292         self.custom.all_meta_types = ZPT_META_TYPES
00293         RAMCacheManager.manage_addRAMCacheManager( self.root
00294                                                  , cache_id
00295                                                  , REQUEST=None
00296                                                  )
00297         self.fsSTX.ZCacheable_setManagerId(cache_id, REQUEST=None)
00298 
00299         self.assertEqual(self.fsSTX.ZCacheable_getManagerId(), cache_id)
00300 
00301         self.fsSTX.manage_doCustomize(folder_path='custom')
00302         custom_pt = self.custom.testSTX
00303 
00304         self.assertEqual(custom_pt.ZCacheable_getManagerId(), cache_id)
00305 

Here is the call graph for this function:

Definition at line 224 of file test_FSSTXMethod.py.

00224 
00225     def test_customize_fspath_as_dot( self ):
00226         self._setWhichTemplate('DTML')
00227 
00228         self.fsSTX.manage_doCustomize(folder_path='.')
00229 
00230         self.failIf('testSTX' in self.custom.objectIds())
00231         self.failUnless('testSTX' in self.skins.objectIds())

Here is the call graph for this function:

Definition at line 232 of file test_FSSTXMethod.py.

00232 
00233     def test_customize_manual_clone( self ):
00234         from OFS.Folder import Folder
00235 
00236         clone = Folder('testSTX')
00237 
00238         self._setWhichTemplate('DTML')
00239 
00240         self.fsSTX.manage_doCustomize(folder_path='custom', obj=clone)
00241 
00242         self.failUnless('testSTX' in self.custom.objectIds())
00243         self.failUnless(aq_base(self.custom._getOb('testSTX')) is clone)

Here is the call graph for this function:

Definition at line 244 of file test_FSSTXMethod.py.

00244 
00245     def test_customize_with_DTML( self ):
00246         from OFS.DTMLDocument import DTMLDocument
00247         from Products.CMFCore.FSSTXMethod import _CUSTOMIZED_TEMPLATE_DTML
00248 
00249         self._setWhichTemplate('DTML')
00250 
00251         self.fsSTX.manage_doCustomize(folder_path='custom')
00252 
00253         self.assertEqual(len(self.custom.objectIds()), 1)
00254         self.failUnless('testSTX' in self.custom.objectIds())
00255         target = self.custom._getOb('testSTX')
00256 
00257         self.failUnless(isinstance(target, DTMLDocument))
00258 
00259         propinfo = target.propdict()['stx']
00260         self.assertEqual(propinfo['type'], 'text')
00261         self.assertEqual(target.stx, self.fsSTX.raw)
00262 
00263         self.assertEqual(target.document_src(), _CUSTOMIZED_TEMPLATE_DTML)

Here is the call graph for this function:

Definition at line 264 of file test_FSSTXMethod.py.

00264 
00265     def test_customize_with_ZPT( self ):
00266         from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
00267         from Products.CMFCore.FSSTXMethod import _CUSTOMIZED_TEMPLATE_ZPT
00268 
00269         self._setWhichTemplate('ZPT')
00270         self.custom.all_meta_types = ZPT_META_TYPES
00271 
00272         self.fsSTX.manage_doCustomize(folder_path='custom')
00273 
00274         self.assertEqual(len(self.custom.objectIds()), 1)
00275         self.failUnless('testSTX' in self.custom.objectIds())
00276         target = self.custom._getOb('testSTX')
00277 
00278         self.failUnless(isinstance(target, ZopePageTemplate))
00279 
00280         propinfo = target.propdict()['stx']
00281         self.assertEqual(propinfo['type'], 'text')
00282         self.assertEqual(target.stx, self.fsSTX.raw)
00283 
00284         self.assertEqual(_normalize_whitespace(target.document_src()),
00285                          _normalize_whitespace(_CUSTOMIZED_TEMPLATE_ZPT))

Here is the call graph for this function:


Member Data Documentation

Definition at line 197 of file test_FSSTXMethod.py.

Definition at line 200 of file test_FSSTXMethod.py.

Definition at line 205 of file test_FSSTXMethod.py.

Definition at line 194 of file test_FSSTXMethod.py.


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