Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testRemoveCMFTopicSkinPathFromDefault
def testRemoveCMFTopicSkinTwice
def testRemoveCMFTopicSkinNoTool
def testRemoveCMFTopicSkinPathNoLayer
def testAddRenameObjectButton
def testAddRenameObjectButtonTwice
def testAddRenameObjectButtonActionExists
def testAddRenameObjectButtonNoTool
def testAddSEHighLightJS
def testRemoveDiscussionItemWorkflow
def testRemoveDiscussionItemWorkflowNoTool
def testRemoveDiscussionItemWorkflowNoType
def testRemoveDiscussionItemWorkflowTwice
def testAddMustChangePassword
def testAddMustChangePasswordTwice
def testAddMustChangePasswordNoTool
def testReinstallPortalTransforms
def testReinstallPortalTransformsTwice
def testReinstallPortalTransformsNoTool
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
 memberdata
 skins
 types
 workflow

Detailed Description

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

00377 
00378     def afterSetUp(self):
00379         self.actions = self.portal.portal_actions
00380         self.memberdata = self.portal.portal_memberdata
00381         self.skins = self.portal.portal_skins
00382         self.types = self.portal.portal_types
00383         self.workflow = self.portal.portal_workflow

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

00474 
00475     def testAddMustChangePassword(self):
00476         # Should add the 'must change password' property
00477         self.removeMemberdataProperty('must_change_password')
00478         self.failIf(self.memberdata.hasProperty('must_change_password'))
00479         addMemberData(self.portal, [])
00480         self.failUnless(self.memberdata.hasProperty('must_change_password'))

Here is the call graph for this function:

Definition at line 489 of file testMigrations.py.

00489 
00490     def testAddMustChangePasswordNoTool(self):
00491         # Should not fail if portal_memberdata is missing
00492         self.portal._delObject('portal_memberdata')
00493         addMemberData(self.portal, [])

Here is the call graph for this function:

Definition at line 481 of file testMigrations.py.

00481 
00482     def testAddMustChangePasswordTwice(self):
00483         # Should not fail if migrated again
00484         self.removeMemberdataProperty('must_change_password')
00485         self.failIf(self.memberdata.hasProperty('must_change_password'))
00486         addMemberData(self.portal, [])
00487         addMemberData(self.portal, [])
00488         self.failUnless(self.memberdata.hasProperty('must_change_password'))

Here is the call graph for this function:

Definition at line 411 of file testMigrations.py.

00411 
00412     def testAddRenameObjectButton(self):
00413         # Should add 'rename' object_button action
00414         editActions = self.actions.object_buttons.objectIds()
00415         assert 'rename' in editActions
00416         self.removeActionFromTool('rename', 'object_buttons')
00417         addRenameObjectButton(self.portal, [])
00418         actions = self.actions.object_buttons.objectIds()
00419         self.assertEqual(sorted(actions), sorted(editActions))

Here is the call graph for this function:

Definition at line 430 of file testMigrations.py.

00430 
00431     def testAddRenameObjectButtonActionExists(self):
00432         # Should add 'rename' object_button action
00433         editActions = self.actions.object_buttons.objectIds()
00434         assert 'rename' in editActions
00435         addRenameObjectButton(self.portal, [])
00436         actions = self.actions.object_buttons.objectIds()
00437         self.assertEqual(sorted(actions), sorted(editActions))

Here is the call graph for this function:

Definition at line 438 of file testMigrations.py.

00438 
00439     def testAddRenameObjectButtonNoTool(self):
00440         # Should not fail if tool is missing
00441         self.portal._delObject('portal_actions')
00442         addRenameObjectButton(self.portal, [])

Here is the call graph for this function:

Definition at line 420 of file testMigrations.py.

00420 
00421     def testAddRenameObjectButtonTwice(self):
00422         # Should not fail if migrated again
00423         editActions = self.actions.object_buttons.objectIds()
00424         assert 'rename' in editActions
00425         self.removeActionFromTool('rename', 'object_buttons')
00426         addRenameObjectButton(self.portal, [])
00427         addRenameObjectButton(self.portal, [])
00428         actions = self.actions.object_buttons.objectIds()
00429         self.assertEqual(sorted(actions), sorted(editActions))

Here is the call graph for this function:

Definition at line 443 of file testMigrations.py.

00443 
00444     def testAddSEHighLightJS(self):
00445         jsreg = self.portal.portal_javascripts
00446         script_ids = jsreg.getResourceIds()
00447         self.failUnless('se-highlight.js' in script_ids)
00448         # if highlightsearchterms.js is available se-highlight.js
00449         # should be positioned right underneath it
00450         if 'highlightsearchterms.js' in script_ids:
00451             posSE = jsreg.getResourcePosition('se-highlight.js')
00452             posHST = jsreg.getResourcePosition('highlightsearchterms.js')
00453             self.failUnless((posSE - 1) == posHST)

Definition at line 494 of file testMigrations.py.

00494 
00495     def testReinstallPortalTransforms(self):
00496         self.portal._delObject('portal_transforms')
00497         reinstallPortalTransforms(self.portal, [])
00498         self.failUnless(hasattr(self.portal.aq_base, 'portal_transforms'))

Here is the call graph for this function:

Definition at line 505 of file testMigrations.py.

00505 
00506     def testReinstallPortalTransformsNoTool(self):
00507         self.portal._delObject('portal_quickinstaller')
00508         reinstallPortalTransforms(self.portal, [])
00509 

Here is the call graph for this function:

Definition at line 499 of file testMigrations.py.

00499 
00500     def testReinstallPortalTransformsTwice(self):
00501         self.portal._delObject('portal_transforms')
00502         reinstallPortalTransforms(self.portal, [])
00503         reinstallPortalTransforms(self.portal, [])
00504         self.failUnless(hasattr(self.portal.aq_base, 'portal_transforms'))

Here is the call graph for this function:

Definition at line 399 of file testMigrations.py.

00399 
00400     def testRemoveCMFTopicSkinNoTool(self):
00401         # Should not fail if tool is missing
00402         self.portal._delObject('portal_skins')
00403         removeCMFTopicSkinLayer(self.portal, [])

Here is the call graph for this function:

Definition at line 384 of file testMigrations.py.

00384 
00385     def testRemoveCMFTopicSkinPathFromDefault(self):
00386         # Should remove plone_3rdParty/CMFTopic from skin paths
00387         self.addSkinLayer('plone_3rdParty/CMFTopic')
00388         removeCMFTopicSkinLayer(self.portal, [])
00389         path = self.skins.getSkinPath('Plone Default')
00390         self.failIf('plone_3rdParty/CMFTopic' in path)

Here is the call graph for this function:

Definition at line 404 of file testMigrations.py.

00404 
00405     def testRemoveCMFTopicSkinPathNoLayer(self):
00406         # Should not fail if plone_3rdParty layer is missing
00407         self.removeSkinLayer('plone_3rdParty')
00408         removeCMFTopicSkinLayer(self.portal, [])
00409         path = self.skins.getSkinPath('Plone Default')
00410         self.failIf('plone_3rdParty/CMFTopic' in path)

Here is the call graph for this function:

Definition at line 391 of file testMigrations.py.

00391 
00392     def testRemoveCMFTopicSkinTwice(self):
00393         # Should not fail if migrated again
00394         self.addSkinLayer('plone_3rdParty/CMFTopic')
00395         removeCMFTopicSkinLayer(self.portal, [])
00396         removeCMFTopicSkinLayer(self.portal, [])
00397         path = self.skins.getSkinPath('Plone Default')
00398         self.failIf('plone_3rdParty/CMFTopic' in path)

Here is the call graph for this function:

Definition at line 454 of file testMigrations.py.

00454 
00455     def testRemoveDiscussionItemWorkflow(self):
00456         self.workflow.setChainForPortalTypes(('Discussion Item',), ('(Default)',))
00457         removeDiscussionItemWorkflow(self.portal, [])
00458         self.assertEqual(self.workflow.getChainForPortalType('Discussion Item'), ())

Here is the call graph for this function:

Definition at line 459 of file testMigrations.py.

00459 
00460     def testRemoveDiscussionItemWorkflowNoTool(self):
00461         self.portal._delObject('portal_workflow')
00462         removeDiscussionItemWorkflow(self.portal, [])

Here is the call graph for this function:

Definition at line 463 of file testMigrations.py.

00463 
00464     def testRemoveDiscussionItemWorkflowNoType(self):
00465         self.types._delObject('Discussion Item')
00466         removeDiscussionItemWorkflow(self.portal, [])

Here is the call graph for this function:

Definition at line 467 of file testMigrations.py.

00467 
00468     def testRemoveDiscussionItemWorkflowTwice(self):
00469         self.workflow.setChainForPortalTypes(('Discussion Item',), ('(Default)',))
00470         removeDiscussionItemWorkflow(self.portal, [])
00471         self.assertEqual(self.workflow.getChainForPortalType('Discussion Item'), ())
00472         removeDiscussionItemWorkflow(self.portal, [])
00473         self.assertEqual(self.workflow.getChainForPortalType('Discussion Item'), ())

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

Definition at line 379 of file testMigrations.py.

Definition at line 380 of file testMigrations.py.

Definition at line 381 of file testMigrations.py.

Definition at line 382 of file testMigrations.py.


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