Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testMigrations.TestMigrations_v2_1_1 Class Reference
Inheritance diagram for CMFPlone.tests.testMigrations.TestMigrations_v2_1_1:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testMigrations.TestMigrations_v2_1_1:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testReindexPathIndex
def testReindexPathIndexTwice
def testReindexPathIndexNoIndex
def testReindexPathIndexNoCatalog
def removeActionFromTool
def removeActionIconFromTool
def addResourceToJSTool
def addResourceToCSSTool
def removeSiteProperty
def addSiteProperty
def removeNavTreeProperty
def addNavTreeProperty
def removeMemberdataProperty
def uninstallProduct
def addSkinLayer
def removeSkinLayer
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 actions
 icons
 properties
 memberdata
 membership
 catalog
 groups
 factory
 portal_memberdata
 cp
 skins

Detailed Description

Definition at line 314 of file testMigrations.py.


Member Function Documentation

def CMFPlone.tests.testMigrations.MigrationTest.addNavTreeProperty (   self,
  property_id 
) [inherited]

Definition at line 274 of file testMigrations.py.

00274 
00275     def addNavTreeProperty(self, property_id):
00276         # adds a navtree property to portal_properties
00277         tool = getattr(self.portal, 'portal_properties')
00278         sheet = getattr(tool, 'navtree_properties')
00279         if not sheet.hasProperty(property_id):
00280             sheet.manage_addProperty(property_id,[],'lines')

Here is the call graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.addResourceToCSSTool (   self,
  resource_name 
) [inherited]

Definition at line 247 of file testMigrations.py.

00247 
00248     def addResourceToCSSTool(self, resource_name):
00249         # Registers a resource with the css tool
00250         tool = getattr(self.portal, 'portal_css')
00251         if not resource_name in tool.getResourceIds():
00252             tool.registerStylesheet(resource_name)

Here is the call graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.addResourceToJSTool (   self,
  resource_name 
) [inherited]

Definition at line 241 of file testMigrations.py.

00241 
00242     def addResourceToJSTool(self, resource_name):
00243         # Registers a resource with the javascripts tool
00244         tool = getattr(self.portal, 'portal_javascripts')
00245         if not resource_name in tool.getResourceIds():
00246             tool.registerScript(resource_name)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.addSiteProperty (   self,
  property_id 
) [inherited]

Definition at line 260 of file testMigrations.py.

00260 
00261     def addSiteProperty(self, property_id):
00262         # adds a site property to portal_properties
00263         tool = getattr(self.portal, 'portal_properties')
00264         sheet = getattr(tool, 'site_properties')
00265         if not sheet.hasProperty(property_id):
00266             sheet.manage_addProperty(property_id,[],'lines')

Here is the call graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.addSkinLayer (   self,
  layer,
  skin = 'Plone Default',
  pos = None 
) [inherited]

Definition at line 293 of file testMigrations.py.

00293 
00294     def addSkinLayer(self, layer, skin='Plone Default', pos=None):
00295         # Adds a skin layer at pos. If pos is None, the layer is appended
00296         path = self.skins.getSkinPath(skin)
00297         path = [x.strip() for x in path.split(',')]
00298         if layer in path:
00299             path.remove(layer)
00300         if pos is None:
00301             path.append(layer)
00302         else:
00303             path.insert(pos, layer)
00304         self.skins.addSkinSelection(skin, ','.join(path))

Here is the caller graph for this function:

Definition at line 316 of file testMigrations.py.

00316 
00317     def afterSetUp(self):
00318         self.actions = self.portal.portal_actions
00319         self.icons = self.portal.portal_actionicons
00320         self.properties = self.portal.portal_properties
00321         self.memberdata = self.portal.portal_memberdata
00322         self.membership = self.portal.portal_membership
00323         self.catalog = self.portal.portal_catalog
00324         self.groups = self.portal.portal_groups
00325         self.factory = self.portal.portal_factory
00326         self.portal_memberdata = self.portal.portal_memberdata
00327         self.cp = self.portal.portal_controlpanel
00328         self.skins = self.portal.portal_skins

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeActionFromTool (   self,
  action_id,
  category = None,
  action_provider = 'portal_actions' 
) [inherited]

Definition at line 222 of file testMigrations.py.

00222 
00223     def removeActionFromTool(self, action_id, category=None, action_provider='portal_actions'):
00224         # Removes an action from portal_actions
00225         tool = getattr(self.portal, action_provider)
00226         if category is None:
00227             if action_id in tool.objectIds() and IActionInfo.providedBy(tool._getOb(action_id)):
00228                 tool._delOb(action_id)
00229         else:
00230             if category in tool.objectIds() and IActionCategory.providedBy(tool._getOb(category)):
00231                 if action_id in tool.objectIds() and IActionInfo.providedBy(tool._getOb(action_id)):
00232                     tool._delOb(action_id)

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeActionIconFromTool (   self,
  action_id,
  category = 'plone' 
) [inherited]

Definition at line 233 of file testMigrations.py.

00233 
00234     def removeActionIconFromTool(self, action_id, category='plone'):
00235         # Removes an action icon from portal_actionicons
00236         tool = getattr(self.portal, 'portal_actionicons')
00237         try:
00238             tool.removeActionIcon(category, action_id)
00239         except KeyError:
00240             pass # No icon associated

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeMemberdataProperty (   self,
  property_id 
) [inherited]

Definition at line 281 of file testMigrations.py.

00281 
00282     def removeMemberdataProperty(self, property_id):
00283         # Removes a memberdata property from portal_memberdata
00284         tool = getattr(self.portal, 'portal_memberdata')
00285         if tool.hasProperty(property_id):
00286             tool.manage_delProperties([property_id])

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeNavTreeProperty (   self,
  property_id 
) [inherited]

Definition at line 267 of file testMigrations.py.

00267 
00268     def removeNavTreeProperty(self, property_id):
00269         # Removes a navtree property from portal_properties
00270         tool = getattr(self.portal, 'portal_properties')
00271         sheet = getattr(tool, 'navtree_properties')
00272         if sheet.hasProperty(property_id):
00273             sheet.manage_delProperties([property_id])

Here is the call graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeSiteProperty (   self,
  property_id 
) [inherited]

Definition at line 253 of file testMigrations.py.

00253 
00254     def removeSiteProperty(self, property_id):
00255         # Removes a site property from portal_properties
00256         tool = getattr(self.portal, 'portal_properties')
00257         sheet = getattr(tool, 'site_properties')
00258         if sheet.hasProperty(property_id):
00259             sheet.manage_delProperties([property_id])

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.removeSkinLayer (   self,
  layer,
  skin = 'Plone Default' 
) [inherited]

Definition at line 305 of file testMigrations.py.

00305 
00306     def removeSkinLayer(self, layer, skin='Plone Default'):
00307         # Removes a skin layer from skin
00308         path = self.skins.getSkinPath(skin)
00309         path = [x.strip() for x in path.split(',')]
00310         if layer in path:
00311             path.remove(layer)
00312             self.skins.addSkinSelection(skin, ','.join(path))
00313 

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 329 of file testMigrations.py.

00329 
00330     def testReindexPathIndex(self):
00331         # Should reindex the path index to create new index structures
00332         orig_results = self.catalog(path={'query':'news', 'level':1})
00333         orig_len = len(orig_results)
00334         self.failUnless(orig_len)
00335         # Simulate the old EPI
00336         delattr(self.catalog.Indexes['path'], '_index_parents')
00337         self.assertRaises(AttributeError, self.catalog,
00338                                         {'path':{'query':'/','navtree':1}})
00339         reindexPathIndex(self.portal, [])
00340         results = self.catalog(path={'query':'news', 'level':1})
00341         self.assertEqual(len(results), orig_len)

Here is the call graph for this function:

Definition at line 369 of file testMigrations.py.

00369 
00370     def testReindexPathIndexNoCatalog(self):
00371         # Should not fail when index is missing
00372         self.portal._delObject('portal_catalog')
00373         reindexPathIndex(self.portal, [])
00374 

Here is the call graph for this function:

Definition at line 364 of file testMigrations.py.

00364 
00365     def testReindexPathIndexNoIndex(self):
00366         # Should not fail when index is missing
00367         self.catalog.delIndex('path')
00368         reindexPathIndex(self.portal, [])

Here is the call graph for this function:

Definition at line 342 of file testMigrations.py.

00342 
00343     def testReindexPathIndexTwice(self):
00344         # Should not fail when migrated twice, should do nothing if already
00345         # migrated
00346         orig_results = self.catalog(path={'query':'news', 'level':1})
00347         orig_len = len(orig_results)
00348         self.failUnless(orig_len)
00349         # Simulate the old EPI
00350         delattr(self.catalog.Indexes['path'], '_index_parents')
00351         self.assertRaises(AttributeError, self.catalog,
00352                                         {'path':{'query':'/','navtree':1}})
00353         out = []
00354         reindexPathIndex(self.portal, out)
00355         # Should return a message on the first iteration
00356         self.failUnless(out)
00357         out = []
00358         reindexPathIndex(self.portal, out)
00359         results = self.catalog(path={'query':'news', 'level':1})
00360         self.assertEqual(len(results), orig_len)
00361         # should return an empty list on the second iteration because nothing
00362         # was done
00363         self.failIf(out)

Here is the call graph for this function:

def CMFPlone.tests.testMigrations.MigrationTest.uninstallProduct (   self,
  product_name 
) [inherited]

Definition at line 287 of file testMigrations.py.

00287 
00288     def uninstallProduct(self, product_name):
00289         # Removes a product
00290         tool = getattr(self.portal, 'portal_quickinstaller')
00291         if tool.isProductInstalled(product_name):
00292             tool.uninstallProducts([product_name])

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 317 of file testMigrations.py.

Definition at line 322 of file testMigrations.py.

Definition at line 326 of file testMigrations.py.

Definition at line 324 of file testMigrations.py.

Definition at line 323 of file testMigrations.py.

Definition at line 318 of file testMigrations.py.

Definition at line 320 of file testMigrations.py.

Definition at line 321 of file testMigrations.py.

Definition at line 325 of file testMigrations.py.

Definition at line 319 of file testMigrations.py.

Definition at line 327 of file testMigrations.py.


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