Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions
CMFCore.tests.test_CMFCatalogAware.CMFCatalogAware_CopySupport_Tests Class Reference
Inheritance diagram for CMFCore.tests.test_CMFCatalogAware.CMFCatalogAware_CopySupport_Tests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_CMFCatalogAware.CMFCatalogAware_CopySupport_Tests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_object_indexed_after_adding
def test_object_unindexed_after_removing
def test_object_indexed_after_copy_and_pasting
def test_object_reindexed_after_cut_and_paste
def test_object_reindexed_after_moving

Static Public Attributes

 layer = EventZCMLLayer

Private Member Functions

def _makeSite
def _initPolicyAndUser

Detailed Description

Definition at line 220 of file test_CMFCatalogAware.py.


Member Function Documentation

def CMFCore.tests.test_CMFCatalogAware.CMFCatalogAware_CopySupport_Tests._initPolicyAndUser (   self,
  a_lambda = None,
  v_lambda = None,
  c_lambda = None 
) [private]

Definition at line 239 of file test_CMFCatalogAware.py.

00239 
00240                           ):
00241         from AccessControl import SecurityManager
00242 
00243         def _promiscuous( *args, **kw ):
00244             return 1
00245 
00246         if a_lambda is None:
00247             a_lambda = _promiscuous
00248 
00249         if v_lambda is None:
00250             v_lambda = _promiscuous
00251 
00252         if c_lambda is None:
00253             c_lambda = _promiscuous
00254 
00255         scp = _SensitiveSecurityPolicy( v_lambda, c_lambda )
00256         SecurityManager.setSecurityPolicy( scp )
00257         newSecurityManager( None
00258                           , _AllowedUser(a_lambda).__of__(self.app.acl_users))

Here is the caller graph for this function:

Definition at line 224 of file test_CMFCatalogAware.py.

00224 
00225     def _makeSite(self):
00226         self.app._setObject('site', SimpleFolder('site'))
00227         site = self.app._getOb('site')
00228         site._setObject('portal_catalog', DummyCatalog())
00229         site._setObject('portal_workflow', DummyWorkflowTool())
00230         # Hack, we need a _p_mtime for the file, so we make sure that it
00231         # has one. We use a subtransaction, which means we can rollback
00232         # later and pretend we didn't touch the ZODB.
00233         transaction.savepoint(optimistic=True)
00234         return site

Here is the call graph for this function:

Definition at line 259 of file test_CMFCatalogAware.py.

00259 
00260     def test_object_indexed_after_adding(self):
00261 
00262         site = self._makeSite()
00263         bar = TheClass('bar')
00264         site._setObject('bar', bar)
00265         cat = site.portal_catalog
00266         self.assertEquals(cat.log, ["index /site/bar"])

Here is the call graph for this function:

Definition at line 277 of file test_CMFCatalogAware.py.

00277 
00278     def test_object_indexed_after_copy_and_pasting(self):
00279 
00280         self._initPolicyAndUser() # allow copy/paste operations
00281         site = self._makeSite()
00282         site.folder1 = SimpleFolder('folder1')
00283         folder1 = site.folder1
00284         site.folder2 = SimpleFolder('folder2')
00285         folder2 = site.folder2
00286 
00287         bar = TheClass('bar')
00288         folder1._setObject('bar', bar)
00289         cat = site.portal_catalog
00290         cat.log = []
00291 
00292         transaction.savepoint(optimistic=True)
00293 
00294         cookie = folder1.manage_copyObjects(ids=['bar'])
00295         folder2.manage_pasteObjects(cookie)
00296 
00297         self.assertEquals(cat.log, ["index /site/folder2/bar"])

Here is the call graph for this function:

Definition at line 298 of file test_CMFCatalogAware.py.

00298 
00299     def test_object_reindexed_after_cut_and_paste(self):
00300 
00301         self._initPolicyAndUser() # allow copy/paste operations
00302         site = self._makeSite()
00303         site.folder1 = SimpleFolder('folder1')
00304         folder1 = site.folder1
00305         site.folder2 = SimpleFolder('folder2')
00306         folder2 = site.folder2
00307 
00308         bar = TheClass('bar')
00309         folder1._setObject('bar', bar)
00310         cat = site.portal_catalog
00311         cat.log = []
00312 
00313         transaction.savepoint(optimistic=True)
00314 
00315         cookie = folder1.manage_cutObjects(ids=['bar'])
00316         folder2.manage_pasteObjects(cookie)
00317 
00318         self.assertEquals(cat.log, ["unindex /site/folder1/bar",
00319                                     "index /site/folder2/bar"])

Here is the call graph for this function:

Definition at line 320 of file test_CMFCatalogAware.py.

00320 
00321     def test_object_reindexed_after_moving(self):
00322 
00323         self._initPolicyAndUser() # allow copy/paste operations
00324         site = self._makeSite()
00325 
00326         bar = TheClass('bar')
00327         site._setObject('bar', bar)
00328         cat = site.portal_catalog
00329         cat.log = []
00330 
00331         transaction.savepoint(optimistic=True)
00332 
00333         site.manage_renameObject(id='bar', new_id='baz')
00334         self.assertEquals(cat.log, ["unindex /site/bar",
00335                                     "index /site/baz"])
00336 

Here is the call graph for this function:

Definition at line 267 of file test_CMFCatalogAware.py.

00267 
00268     def test_object_unindexed_after_removing(self):
00269 
00270         site = self._makeSite()
00271         bar = TheClass('bar')
00272         site._setObject('bar', bar)
00273         cat = site.portal_catalog
00274         cat.log = []
00275         site._delObject('bar')
00276         self.assertEquals(cat.log, ["unindex /site/bar"])

Here is the call graph for this function:


Member Data Documentation

Definition at line 222 of file test_CMFCatalogAware.py.


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