Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testInstallPlacefulWorkflow
def testInstallPlacefulWorkflowTwice
def testInstallPortalSetup
def testInstallPortalSetupTwice
def testInstallPlonePAS
def testInstallPlonePASTwice
def testInstallPlonePASWithEnvironmentVariableSet
def testInstallDeprecated
def testInstallDeprecatedTwice
def testInstallDeprecatedNoTool
def testAddDragDropReorderJS
def testAddGetEventTypeIndex
def testAddGetEventTypeIndexTwice
def testAddGetEventTypeIndexNoCatalog
def testFixHomeAction
def testFixHomeActionTwice
def testFixHomeActionNoTool
def testRemoveBogusSkin
def testAddPloneSkinLayers
def testRemoveBogusSkinTwice
def testRemoveBogusSkinNoSkin
def testRemoveBogusSkinNoTool
def testSimplifyActions
def testSimplifyActionsTwice
def testSimplifyActionsNoTool
def testMigrateCSSRegExpression
def testMigrateCSSRegExpressionWith25Expression
def testMigrateCSSRegExpressionTwice
def testMigrateCSSRegExpressionNoTool
def testMigrateCSSRegExpressionNoResource
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
 catalog
 skins
 types
 workflow

Detailed Description

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

00654 
00655     def afterSetUp(self):
00656         self.actions = self.portal.portal_actions
00657         self.memberdata = self.portal.portal_memberdata
00658         self.catalog = self.portal.portal_catalog
00659         self.skins = self.portal.portal_skins
00660         self.types = self.portal.portal_types
00661         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 762 of file testMigrations.py.

00762 
00763     def testAddDragDropReorderJS(self):
00764         jsreg = self.portal.portal_javascripts
00765         script_ids = jsreg.getResourceIds()
00766         self.failUnless('dragdropreorder.js' in script_ids)
00767         # if dropdown.js is available dragdropreorder.js
00768         # should be positioned right underneath it
00769         if 'dropdown.js' in script_ids:
00770             posSE = jsreg.getResourcePosition('dragdropreorder.js')
00771             posHST = jsreg.getResourcePosition('select_all.js')
00772             self.failUnless((posSE - 1) == posHST)

Definition at line 773 of file testMigrations.py.

00773 
00774     def testAddGetEventTypeIndex(self):
00775         # Should add getEventType index
00776         self.catalog.delIndex('getEventType')
00777         addGetEventTypeIndex(self.portal, [])
00778         index = self.catalog._catalog.getIndex('getEventType')
00779         self.assertEqual(index.__class__.__name__, 'KeywordIndex')

Here is the call graph for this function:

Definition at line 788 of file testMigrations.py.

00788 
00789     def testAddGetEventTypeIndexNoCatalog(self):
00790         # Should not fail if portal_catalog is missing
00791         self.portal._delObject('portal_catalog')
00792         addGetEventTypeIndex(self.portal, [])

Here is the call graph for this function:

Definition at line 780 of file testMigrations.py.

00780 
00781     def testAddGetEventTypeIndexTwice(self):
00782         # Should not fail if migrated again
00783         self.catalog.delIndex('getEventType')
00784         addGetEventTypeIndex(self.portal, [])
00785         addGetEventTypeIndex(self.portal, [])
00786         index = self.catalog._catalog.getIndex('getEventType')
00787         self.assertEqual(index.__class__.__name__, 'KeywordIndex')

Here is the call graph for this function:

Definition at line 825 of file testMigrations.py.

00825 
00826     def testAddPloneSkinLayers(self):
00827         # Add bogus skin
00828         self.skins.manage_skinLayers(add_skin=1, skinname='foo_bar',
00829                                   skinpath=['plone_forms','plone_templates'])
00830         self.failUnless(self.skins._getSelections().has_key('foo_bar'))
00831 
00832         path = [p.strip() for p in self.skins.getSkinPath('foo_bar').split(',')]
00833         self.assertEqual(['plone_forms', 'plone_templates'], path)
00834 
00835         addPloneSkinLayers(self.portal, [])
00836 
00837         path = [p.strip() for p in self.skins.getSkinPath('foo_bar').split(',')]
00838         self.assertEqual(['plone_forms', 'plone_templates', 'plone_deprecated'], path)

Here is the call graph for this function:

Definition at line 793 of file testMigrations.py.

00793 
00794     def testFixHomeAction(self):
00795         editActions = ('index_html',)
00796         for a in editActions:
00797             self.removeActionFromTool(a)
00798         fixHomeAction(self.portal, [])
00799         actions = [x.id for x in self.actions.listActions()]
00800         for a in editActions:
00801             self.failUnless(a in actions)

Here is the call graph for this function:

Definition at line 812 of file testMigrations.py.

00812 
00813     def testFixHomeActionNoTool(self):
00814         self.portal._delObject('portal_actions')
00815         fixHomeAction(self.portal, [])

Here is the call graph for this function:

Definition at line 802 of file testMigrations.py.

00802 
00803     def testFixHomeActionTwice(self):
00804         editActions = ('index_html',)
00805         for a in editActions:
00806             self.removeActionFromTool(a)
00807         fixHomeAction(self.portal, [])
00808         fixHomeAction(self.portal, [])
00809         actions = [x.id for x in self.actions.listActions()]
00810         for a in editActions:
00811             self.failUnless(a in actions)

Here is the call graph for this function:

Definition at line 719 of file testMigrations.py.

00719 
00720     def testInstallDeprecated(self):
00721         # Remove skin
00722         self.skins._delObject('plone_deprecated')
00723         skins = ['Plone Default']
00724         for s in skins:
00725             path = self.skins.getSkinPath(s)
00726             path = [p.strip() for p in  path.split(',')]
00727             path.remove('plone_deprecated')
00728             self.skins.addSkinSelection(s, ','.join(path))
00729         self.failIf('plone_deprecated' in
00730                            self.skins.getSkinPath('Plone Default').split(','))
00731         installDeprecated(self.portal, [])
00732         self.failUnless('plone_deprecated' in self.skins.objectIds())
00733         # it should be in the skin now
00734         self.assertEqual(self.skins.getSkinPath('Plone Default').split(',')[-3],
00735                          'plone_deprecated')

Here is the call graph for this function:

Definition at line 757 of file testMigrations.py.

00757 
00758     def testInstallDeprecatedNoTool(self):
00759         # Remove skin
00760         self.portal._delObject('portal_skins')
00761         installDeprecated(self.portal, [])

Here is the call graph for this function:

Definition at line 736 of file testMigrations.py.

00736 
00737     def testInstallDeprecatedTwice(self):
00738         # Remove skin
00739         self.skins._delObject('plone_deprecated')
00740         skins = ['Plone Default']
00741         for s in skins:
00742             path = self.skins.getSkinPath(s)
00743             path = [p.strip() for p in  path.split(',')]
00744             path.remove('plone_deprecated')
00745             self.skins.addSkinSelection(s, ','.join(path))
00746         self.failIf('plone_deprecated' in
00747                            self.skins.getSkinPath('Plone Default').split(','))
00748         skin_len = len(self.skins.getSkinPath('Plone Default').split(','))
00749         installDeprecated(self.portal, [])
00750         installDeprecated(self.portal, [])
00751         self.failUnless('plone_deprecated' in self.skins.objectIds())
00752         # it should be in the skin now
00753         self.assertEqual(self.skins.getSkinPath('Plone Default').split(',')[-3],
00754                          'plone_deprecated')
00755         self.assertEqual(len(self.skins.getSkinPath('Plone Default').split(',')),
00756                          skin_len+1)

Here is the call graph for this function:

Definition at line 662 of file testMigrations.py.

00662 
00663     def testInstallPlacefulWorkflow(self):
00664         if 'portal_placefulworkflow' in self.portal.objectIds():
00665             self.portal._delObject('portal_placeful_workflow')
00666         installPlacefulWorkflow(self.portal, [])
00667         self.failUnless('portal_placeful_workflow' in self.portal.objectIds())

Here is the call graph for this function:

Definition at line 668 of file testMigrations.py.

00668 
00669     def testInstallPlacefulWorkflowTwice(self):
00670         if 'portal_placefulworkflow' in self.portal.objectIds():
00671             self.portal._delObject('portal_placeful_workflow')
00672         installPlacefulWorkflow(self.portal, [])
00673         installPlacefulWorkflow(self.portal, [])
00674         self.failUnless('portal_placeful_workflow' in self.portal.objectIds())

Here is the call graph for this function:

Definition at line 688 of file testMigrations.py.

00688 
00689     def testInstallPlonePAS(self):
00690         qi = self.portal.portal_quickinstaller
00691         if qi.isProductInstalled('PlonePAS'):
00692             self.setRoles(('Manager',))
00693             qi.uninstallProducts(['PlonePAS'])
00694         self.failIf(qi.isProductInstalled('PlonePAS'))
00695         installPlonePAS(self.portal, [])
00696         self.failUnless(qi.isProductInstalled('PlonePAS'))

Here is the call graph for this function:

Definition at line 697 of file testMigrations.py.

00697 
00698     def testInstallPlonePASTwice(self):
00699         qi = self.portal.portal_quickinstaller
00700         if qi.isProductInstalled('PlonePAS'):
00701             self.setRoles(('Manager',))
00702             qi.uninstallProducts(['PlonePAS'])
00703         installPlonePAS(self.portal, [])
00704         installPlonePAS(self.portal, [])
00705         self.failUnless(qi.isProductInstalled('PlonePAS'))

Here is the call graph for this function:

Definition at line 706 of file testMigrations.py.

00706 
00707     def testInstallPlonePASWithEnvironmentVariableSet(self):
00708         qi = self.portal.portal_quickinstaller
00709         if qi.isProductInstalled('PlonePAS'):
00710             self.setRoles(('Manager',))
00711             qi.uninstallProducts(['PlonePAS'])
00712         self.failIf(qi.isProductInstalled('PlonePAS'))
00713         os.environ['SUPPRESS_PLONEPAS_INSTALLATION'] = 'YES'
00714         installPlonePAS(self.portal, [])
00715         self.failIf(qi.isProductInstalled('PlonePAS'))
00716         del os.environ['SUPPRESS_PLONEPAS_INSTALLATION']
00717         installPlonePAS(self.portal, [])
00718         self.failUnless(qi.isProductInstalled('PlonePAS'))

Here is the call graph for this function:

Definition at line 675 of file testMigrations.py.

00675 
00676     def testInstallPortalSetup(self):
00677         if 'portal_setup' in self.portal.objectIds():
00678             self.portal._delObject('portal_setup')
00679         installPortalSetup(self.portal, [])
00680         self.failUnless('portal_setup' in self.portal.objectIds())

Here is the call graph for this function:

Definition at line 681 of file testMigrations.py.

00681 
00682     def testInstallPortalSetupTwice(self):
00683         if 'portal_setup' in self.portal.objectIds():
00684             self.portal._delObject('portal_setup')
00685         installPortalSetup(self.portal, [])
00686         installPortalSetup(self.portal, [])
00687         self.failUnless('portal_setup' in self.portal.objectIds())

Here is the call graph for this function:

Definition at line 919 of file testMigrations.py.

00919 
00920     def testMigrateCSSRegExpression(self):
00921         # Should convert the expression using a deprecated script to use the
00922         # view
00923         css_reg = self.portal.portal_css
00924         resource = css_reg.getResource('RTL.css')
00925         resource.setExpression("python:object.isRightToLeft(domain='plone')")
00926         css_reg.cookResources()
00927 
00928         # Ensure the change worked
00929         resource = css_reg.getResource('RTL.css')
00930         self.failUnless('object.isRightToLeft' in resource.getExpression())
00931 
00932         # perform the migration
00933         migrateCSSRegExpression(self.portal, [])
00934         self.assertEqual(resource.getExpression(),
00935                 "object/@@plone/isRightToLeft")

Here is the call graph for this function:

Definition at line 968 of file testMigrations.py.

00968 
00969     def testMigrateCSSRegExpressionNoResource(self):
00970         # Should not fail if the resource is missing
00971         css_reg = self.portal.portal_css
00972         css_reg.unregisterResource('RTL.css')
00973         migrateCSSRegExpression(self.portal, [])

Here is the call graph for this function:

Definition at line 963 of file testMigrations.py.

00963 
00964     def testMigrateCSSRegExpressionNoTool(self):
00965         # Should not fail if the tool is missing
00966         self.portal._delObject('portal_css')
00967         migrateCSSRegExpression(self.portal, [])

Here is the call graph for this function:

Definition at line 950 of file testMigrations.py.

00950 
00951     def testMigrateCSSRegExpressionTwice(self):
00952         # Should result in the same string when applied twice
00953         css_reg = self.portal.portal_css
00954         resource = css_reg.getResource('RTL.css')
00955         resource.setExpression("python:object.isRightToLeft(domain='plone')")
00956         css_reg.cookResources()
00957 
00958         # perform the migration twice
00959         migrateCSSRegExpression(self.portal, [])
00960         migrateCSSRegExpression(self.portal, [])
00961         self.assertEqual(resource.getExpression(),
00962                 "object/@@plone/isRightToLeft")

Here is the call graph for this function:

Definition at line 936 of file testMigrations.py.

00936 
00937     def testMigrateCSSRegExpressionWith25Expression(self):
00938         # Should replace the restrictedTraverse call with the more compact
00939         # path expression
00940         css_reg = self.portal.portal_css
00941         resource = css_reg.getResource('RTL.css')
00942         resource.setExpression(
00943 "python:object.restrictedTraverse('@@plone').isRightToLeft(domain='plone')")
00944         css_reg.cookResources()
00945 
00946         # perform the migration
00947         migrateCSSRegExpression(self.portal, [])
00948         self.assertEqual(resource.getExpression(),
00949                 "object/@@plone/isRightToLeft")

Here is the call graph for this function:

Definition at line 816 of file testMigrations.py.

00816 
00817     def testRemoveBogusSkin(self):
00818         # Add bogus skin
00819         self.skins.manage_skinLayers(add_skin=1, skinname='cmf_legacy',
00820                                   skinpath=['plone_forms','plone_templates'])
00821         self.failUnless(self.skins._getSelections().has_key('cmf_legacy'))
00822         removeBogusSkin(self.portal, [])
00823         # It should be gone
00824         self.failIf(self.skins._getSelections().has_key('cmf_legacy'))

Here is the call graph for this function:

Definition at line 847 of file testMigrations.py.

00847 
00848     def testRemoveBogusSkinNoSkin(self):
00849         self.failIf(self.skins._getSelections().has_key('cmf_legacy'))
00850         removeBogusSkin(self.portal, [])
00851         self.failIf(self.skins._getSelections().has_key('cmf_legacy'))

Here is the call graph for this function:

Definition at line 852 of file testMigrations.py.

00852 
00853     def testRemoveBogusSkinNoTool(self):
00854         self.portal._delObject('portal_skins')
00855         removeBogusSkin(self.portal, [])

Here is the call graph for this function:

Definition at line 839 of file testMigrations.py.

00839 
00840     def testRemoveBogusSkinTwice(self):
00841         self.skins.manage_skinLayers(add_skin=1, skinname='cmf_legacy',
00842                                   skinpath=['plone_forms','plone_templates'])
00843         self.failUnless(self.skins._getSelections().has_key('cmf_legacy'))
00844         removeBogusSkin(self.portal, [])
00845         removeBogusSkin(self.portal, [])
00846         self.failIf(self.skins._getSelections().has_key('cmf_legacy'))

Here is the call graph for this function:

Definition at line 856 of file testMigrations.py.

00856 
00857     def testSimplifyActions(self):
00858         # Should simplify a number of actions across multiple tools using the
00859         # view methods
00860         tool = self.portal.portal_actions
00861         paste = tool.object_buttons.paste
00862         rename = tool.object_buttons.rename
00863         contents = tool.object.folderContents
00864         index = tool.portal_tabs.index_html
00865         # Set the expressions and conditions to their 2.5 analogues to test
00866         # every substitution
00867         paste._updateProperty('url_expr',
00868                 'python:"%s/object_paste"%((object.isDefaultPageInFolder() or not object.is_folderish()) and object.getParentNode().absolute_url() or object_url)')
00869         rename._updateProperty('url_expr',
00870                 'python:"%s/object_rename"%(object.isDefaultPageInFolder() and object.getParentNode().absolute_url() or object_url)')
00871         rename.edit('available_expr',
00872                 'python:portal.portal_membership.checkPermission("Delete objects", object.aq_inner.getParentNode()) and portal.portal_membership.checkPermission("Copy or Move", object) and portal.portal_membership.checkPermission("Add portal content", object) and object is not portal and not (object.isDefaultPageInFolder() and object.getParentNode() is portal)')
00873         contents._updateProperty('url_expr',
00874                 "python:((object.isDefaultPageInFolder() and object.getParentNode().absolute_url()) or folder_url)+'/folder_contents'")
00875         index._updateProperty('url_expr',
00876                 'string: ${here/@@plone/navigationRootUrl}')
00877 
00878         # Verify that the changes have been made
00879         paste = tool.object_buttons.paste
00880         self.failUnless("object.isDefaultPageInFolder()" in
00881                                                   paste.getProperty('url_expr'))
00882         # Run the action simplifications
00883         simplifyActions(self.portal, [])
00884         self.assertEqual(paste.getProperty('url_expr'),
00885                 "string:${globals_view/getCurrentFolderUrl}/object_paste")
00886         self.assertEqual(rename.getProperty('url_expr'),
00887                 "string:${globals_view/getCurrentObjectUrl}/object_rename")
00888         self.assertEqual(rename.getProperty('available_expr'),
00889                 'python:checkPermission("Delete objects", globals_view.getParentObject()) and checkPermission("Copy or Move", object) and checkPermission("Add portal content", object) and not globals_view.isPortalOrPortalDefaultPage()')
00890         self.assertEqual(contents.getProperty('url_expr'),
00891                 "string:${globals_view/getCurrentFolderUrl}/folder_contents")
00892         self.assertEqual(index.getProperty('url_expr'),
00893                 "string:${globals_view/navigationRootUrl}")

Here is the call graph for this function:

Definition at line 914 of file testMigrations.py.

00914 
00915     def testSimplifyActionsNoTool(self):
00916         # Sholud not fail if the tool is missing
00917         self.portal._delObject('portal_actions')
00918         simplifyActions(self.portal, [])

Here is the call graph for this function:

Definition at line 894 of file testMigrations.py.

00894 
00895     def testSimplifyActionsTwice(self):
00896         # Should result in the same string when applied twice
00897         tool = self.portal.portal_actions
00898         paste = tool.object_buttons.paste
00899         paste._updateProperty('url_expr',
00900                               'python:"%s/object_paste"%((object.isDefaultPageInFolder() or not object.is_folderish()) and object.getParentNode().absolute_url() or object_url)')
00901 
00902         # Verify that the changes have been made
00903         paste = tool.object_buttons.paste
00904         self.failUnless("object.isDefaultPageInFolder()" in
00905                                 paste.getProperty('url_expr'))
00906 
00907         # Run the action simplifications twice
00908         simplifyActions(self.portal, [])
00909         simplifyActions(self.portal, [])
00910 
00911         # We should have the same result
00912         self.assertEqual(paste.getProperty('url_expr'),
00913                 "string:${globals_view/getCurrentFolderUrl}/object_paste")

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

Definition at line 657 of file testMigrations.py.

Definition at line 656 of file testMigrations.py.

Definition at line 658 of file testMigrations.py.

Definition at line 659 of file testMigrations.py.

Definition at line 660 of file testMigrations.py.


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