Back to index

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

List of all members.

Public Member Functions

def setUp
def tearDown
def test_customize
def test_customize_alternate_root
def test_customize_fpath_as_dot
def test_customize_manual_clone
def test_customize_caching

Public Attributes

 skins
 custom
 fsdir
 fsReST

Detailed Description

Definition at line 151 of file test_FSReSTMethod.py.


Member Function Documentation

Reimplemented from CMFCore.tests.test_FSReSTMethod.FSReSTMaker.

Definition at line 153 of file test_FSReSTMethod.py.

00153 
00154     def setUp(self):
00155         from OFS.Folder import Folder
00156 
00157         SecurityTest.setUp(self)
00158         FSReSTMaker.setUp(self)
00159 
00160         self.root._setObject( 'portal_skins', Folder( 'portal_skins' ) )
00161         self.skins = self.root.portal_skins
00162 
00163         self.skins._setObject( 'custom', Folder( 'custom' ) )
00164         self.custom = self.skins.custom
00165 
00166         self.skins._setObject( 'fsdir', Folder( 'fsdir' ) )
00167         self.fsdir = self.skins.fsdir
00168 
00169         self.fsdir._setObject( 'testReST'
00170                              , self._makeOne( 'testReST', 'testReST.rst' ) )
00171 
00172         self.fsReST = self.fsdir.testReST

Definition at line 173 of file test_FSReSTMethod.py.

00173 
00174     def tearDown(self):
00175         cleanUp()
00176         FSReSTMaker.tearDown(self)
00177         SecurityTest.tearDown(self)

Here is the call graph for this function:

Definition at line 178 of file test_FSReSTMethod.py.

00178 
00179     def test_customize( self ):
00180         from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
00181         from Products.CMFCore.FSReSTMethod import _CUSTOMIZED_TEMPLATE_ZPT
00182 
00183         self.custom.all_meta_types = ZPT_META_TYPES
00184 
00185         self.fsReST.manage_doCustomize(folder_path='custom')
00186 
00187         self.assertEqual(len(self.custom.objectIds()), 1)
00188         self.failUnless('testReST' in self.custom.objectIds())
00189         target = self.custom._getOb('testReST')
00190 
00191         self.failUnless(isinstance(target, ZopePageTemplate))
00192 
00193         propinfo = target.propdict()['rest']
00194         self.assertEqual(propinfo['type'], 'text')
00195         self.assertEqual(target.rest, self.fsReST.raw)
00196 
00197         self.assertEqual(_normalize_whitespace(target.document_src()),
00198                          _normalize_whitespace(_CUSTOMIZED_TEMPLATE_ZPT))

Here is the call graph for this function:

Definition at line 199 of file test_FSReSTMethod.py.

00199 
00200     def test_customize_alternate_root( self ):
00201         from OFS.Folder import Folder
00202 
00203         self.root.other = Folder('other')
00204 
00205         self.fsReST.manage_doCustomize(folder_path='other', root=self.root)
00206 
00207         self.failIf('testReST' in self.custom.objectIds())
00208         self.failUnless('testReST' in self.root.other.objectIds())

Definition at line 226 of file test_FSReSTMethod.py.

00226 
00227     def test_customize_caching(self):
00228         # Test to ensure that cache manager associations survive customizing
00229         from Products.StandardCacheManagers import RAMCacheManager
00230         cache_id = 'gofast'
00231         self.custom.all_meta_types = ZPT_META_TYPES
00232         RAMCacheManager.manage_addRAMCacheManager( self.root
00233                                                  , cache_id
00234                                                  , REQUEST=None
00235                                                  )
00236         self.fsReST.ZCacheable_setManagerId(cache_id, REQUEST=None)
00237 
00238         self.assertEqual(self.fsReST.ZCacheable_getManagerId(), cache_id)
00239 
00240         self.fsReST.manage_doCustomize(folder_path='custom')
00241         custom_pt = self.custom.testReST
00242 
00243         self.assertEqual(custom_pt.ZCacheable_getManagerId(), cache_id)
00244 

Definition at line 209 of file test_FSReSTMethod.py.

00209 
00210     def test_customize_fpath_as_dot( self ):
00211 
00212         self.fsReST.manage_doCustomize(folder_path='.')
00213 
00214         self.failIf('testReST' in self.custom.objectIds())
00215         self.failUnless('testReST' in self.skins.objectIds())

Definition at line 216 of file test_FSReSTMethod.py.

00216 
00217     def test_customize_manual_clone( self ):
00218         from OFS.Folder import Folder
00219 
00220         clone = Folder('testReST')
00221 
00222         self.fsReST.manage_doCustomize(folder_path='custom', obj=clone)
00223 
00224         self.failUnless('testReST' in self.custom.objectIds())
00225         self.failUnless(aq_base(self.custom._getOb('testReST')) is clone)


Member Data Documentation

Definition at line 163 of file test_FSReSTMethod.py.

Definition at line 166 of file test_FSReSTMethod.py.

Definition at line 171 of file test_FSReSTMethod.py.

Definition at line 160 of file test_FSReSTMethod.py.


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