Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testReinstallCMFPlacefulWorkflow
def testReinstallCMFPlacefulWorkflowDoesNotInstall
def testReinstallCMFPlacefulWorkflowNoTool
def testReplaceLocalRoleManager
def testReplaceLocalRoleManagerTwice
def testReplaceLocalRoleManagerNoPlugin
def testReplaceLocalRoleManagerNoPAS
def testReplaceLocalRoleManagerNoUF
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

 qi
 wf
 ps

Detailed Description

Definition at line 3168 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 3170 of file testMigrations.py.

03170 
03171     def afterSetUp(self):
03172         self.qi = self.portal.portal_quickinstaller
03173         self.wf = self.portal.portal_workflow
03174         self.ps = self.portal.portal_setup

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 3175 of file testMigrations.py.

03175 
03176     def testReinstallCMFPlacefulWorkflow(self):
03177         # first the product needs to be installed
03178         self.qi.installProduct('CMFPlacefulWorkflow')
03179         # Delete existing logs to prevent race condition
03180         self.ps.manage_delObjects(self.ps.objectIds())
03181         # We remove the new marker, to ensure it's added on reinstall
03182         if IPlacefulMarker.providedBy(self.wf):
03183             noLongerProvides(self.wf, IPlacefulMarker)
03184         reinstallCMFPlacefulWorkflow(self.portal, [])
03185         self.failUnless(IPlacefulMarker.providedBy(self.wf))

Here is the call graph for this function:

Definition at line 3186 of file testMigrations.py.

03186 
03187     def testReinstallCMFPlacefulWorkflowDoesNotInstall(self):
03188         reinstallCMFPlacefulWorkflow(self.portal, [])
03189         self.failIf(self.qi.isProductInstalled('CMFPlacefulWorkflow'))

Here is the call graph for this function:

Definition at line 3190 of file testMigrations.py.

03190 
03191     def testReinstallCMFPlacefulWorkflowNoTool(self):
03192         self.portal._delObject('portal_quickinstaller')
03193         reinstallCMFPlacefulWorkflow(self.portal, [])

Here is the call graph for this function:

Definition at line 3194 of file testMigrations.py.

03194 
03195     def testReplaceLocalRoleManager(self):
03196         # first we replace the local role manager with the one from PlonePAS
03197         uf = self.portal.acl_users
03198         # deactivate and remove the borg plugin
03199         uf.plugins.removePluginById('borg_localroles')
03200         uf.manage_delObjects(['borg_localroles'])
03201         # activate the standard plugin
03202         uf.plugins.activatePlugin(ILocalRolesPlugin, 'local_roles')
03203         # Bring things back to normal
03204         replace_local_role_manager(self.portal, [])
03205         plugins = uf.plugins.listPlugins(ILocalRolesPlugin)
03206         self.failUnlessEqual(len(plugins), 1)
03207         self.failUnlessEqual(plugins[0][0], 'borg_localroles')

Here is the call graph for this function:

Definition at line 3238 of file testMigrations.py.

03238 
03239     def testReplaceLocalRoleManagerNoPAS(self):
03240         uf = self.portal.acl_users
03241         # delete the plugin registry
03242         uf._delObject('plugins')
03243         replace_local_role_manager(self.portal, [])

Here is the call graph for this function:

Definition at line 3223 of file testMigrations.py.

03223 
03224     def testReplaceLocalRoleManagerNoPlugin(self):
03225         # first we replace the local role manager with the one from PlonePAS
03226         uf = self.portal.acl_users
03227         # deactivate and remove the borg plugin
03228         uf.plugins.removePluginById('borg_localroles')
03229         uf.manage_delObjects(['borg_localroles'])
03230         # delete the standard plugin
03231         uf.manage_delObjects(['local_roles'])
03232         # Run the migration, which shouldn't fail even if the expected
03233         # plugin is missing
03234         replace_local_role_manager(self.portal, [])
03235         plugins = uf.plugins.listPlugins(ILocalRolesPlugin)
03236         self.failUnlessEqual(len(plugins), 1)
03237         self.failUnlessEqual(plugins[0][0], 'borg_localroles')

Here is the call graph for this function:

Definition at line 3244 of file testMigrations.py.

03244 
03245     def testReplaceLocalRoleManagerNoUF(self):
03246         # Delete the user folder
03247         uf = self.portal._delObject('acl_users')
03248         replace_local_role_manager(self.portal, [])
03249 

Here is the call graph for this function:

Definition at line 3208 of file testMigrations.py.

03208 
03209     def testReplaceLocalRoleManagerTwice(self):
03210         # first we replace the local role manager with the one from PlonePAS
03211         uf = self.portal.acl_users
03212         # deactivate and remove the borg plugin
03213         uf.plugins.removePluginById('borg_localroles')
03214         uf.manage_delObjects(['borg_localroles'])
03215         # activate the standard plugin
03216         uf.plugins.activatePlugin(ILocalRolesPlugin, 'local_roles')
03217         # run the migration twice
03218         replace_local_role_manager(self.portal, [])
03219         replace_local_role_manager(self.portal, [])
03220         plugins = uf.plugins.listPlugins(ILocalRolesPlugin)
03221         self.failUnlessEqual(len(plugins), 1)
03222         self.failUnlessEqual(plugins[0][0], 'borg_localroles')

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 3173 of file testMigrations.py.

Definition at line 3171 of file testMigrations.py.

Definition at line 3172 of file testMigrations.py.


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