Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def disableSite
def testEnableZope3Site
def testEnableZope3SiteTwice
def testAddNewCSSFiles
def testAddNewBeta2CSSFiles
def testAddDefaultAndForbiddenContentTypesProperties
def testAddDefaultAndForbiddenContentTypesPropertiesTwice
def testAddIconForMarkupConfiglet
def testAddIconForMarkupConfigletTwice
def testAddIconForMarkupConfigletNoTool
def testAddMarkupConfiglet
def testAddMarkupConfigletTwice
def testAddMarkupConfigletNoTool
def testAddIconForTypesConfiglet
def testAddIconForTypesConfigletTwice
def testAddIconForTypesConfigletNoTool
def testAddTypesConfiglet
def testAddTypesConfigletTwice
def testAddTypesConfigletNoTool
def testAddFormTabbingJS
def testAddFormInputLabelJS
def testUpdateFTII18NDomain
def testUpdateFTII18NDomainTwice
def testUpdateFTII18NDomainNonAscii
def testLegacyPortletsConverted
def testLegacyPortletsConvertedTwice
def testLegacyPortletsConvertedNoSlots
def testLegacyPortletsConvertedBadSlots
def testLegacyPortletsConvertedNoMembersFolder
def testAddIconForCalendarSettingsConfiglet
def testAddIconForCalendarSettingsConfigletTwice
def testAddIconForCalendarSettingsConfigletNoTool
def testAddCalendarConfiglet
def testAddCalendarConfigletTwice
def testAddCalendarConfigletNoTool
def testUpdateSearchAndMailHostConfiglet
def testUpdateSearchAndMailHostConfigletTwice
def testUpdateSearchAndMailHostConfigletNoTool
def testRegisterToolsAsUtilities
def testDontRegisterToolsAsUtilities
def testInstallKss
def testInstallKssTwice
def testInstallRedirectorUtility
def testInstallRedirectorUtilityTwice
def testAddContentRulesAction
def testAddContentRulesActionTwice
def testAddContentRulesActionNoTool
def testAddContentRulesActionNoCategory
def testAddReaderEditorRoles
def testAddReaderEditorRolesPermissionOnly
def testAddReaderEditorRolesTwice
def testMigrateLocalroleForm
def testMigrateLocalroleFormTwice
def testMigrateLocalroleFormNoTool
def testReorderUserActions
def testReorderUserActionsTwice
def testReorderUserActionsNoTool
def testReorderUserActionsIncompleteActions
def testUpdateRtlCSSexpression
def testUpdateRtlCSSexpressionTwice
def testAddMaintenanceConfiglet
def testAddMaintenanceConfigletTwice
def testAddIconForMaintenanceConfiglet
def testAddIconForMaintenanceConfigletTwice
def testAddMaintenanceProperty
def testAddLinkIntegritySwitch
def testAddInlineEditingSwitch
def testAddTableContents
def testUpdateMemberSecurity
def testPloneS5
def testPASPluginInterfaces
def testInstallContentrulesUtility
def testContentRulesConfiglet
def testUpdateSkinsAndSiteConfiglet
def testUpdateSkinsAndSiteConfigletTwice
def testUpdateSkinsAndSiteConfigletNoTool
def testUpdateConfigletTitles
def testUpdateConfigletTitlesTwice
def testUpdateConfigletTitlesNoTool
def testaddIconsForFilterAndSecurityConfigletsNoTool
def testAddFilterAndSecurityConfiglets
def testAddFilterAndSecurityConfigletsTwice
def testAddFilterAndSecurityConfigletsNoTool
def testAddSitemapProperty
def testUpdateKukitJS
def testAddCacheForResourceRegistry
def testTablelessRemoval
def testUpdateCssQueryJS
def testAddWebstatsJSProperty
def testAddWebstatsJS
def testWebstatsJSTwice
def testaddIconsForFilterAndSecurityConfiglets
def testaddIconsForFilterAndSecurityConfigletsTwice
def testObjectProvidesIndex
def testAddExternalLinksOpenNewWindowProperty
def testAddMissingWorkflowsNoTool
def testAddManyGroupsProperty
def testMigratePloneTool
def testInstallI18NUtilities
def testInstallI18NUtilitiesTwice
def testInstallPloneLanguageTool
def testAddEmailCharsetProperty
def testAddEmailCharsetPropertyTwice
def testChangeOrderOfActionProviders
def testChangeOrderOfActionProvidersTwice
def testCleanupOldActions
def testCleanupOldActionsTwice
def testCharsetCleanup
def testAutoGroupCreated
def testPloneS5
def testAddCacheForKSSRegistry
def testAddContributorToCreationPermissions
def testAddEditorToCreationPermissionsNoStomp
def testAddEditorToCreationPermissionsTwice
def testAddBeta2VersioningPermissionsToNewRoles
def testRemoveSharingAction
def testRemoveSharingActionNoTool
def testRemoveSharingActionTwice
def testAddContributorToCreationPermissions
def testAddEditorToCreationPermissionsNoStomp
def testAddEditorToSecondaryEditPermissionsTwice
def testUpdateEditActionConditionForLocking
def testUpdateEditActionConditionForLockingTwice
def testUpdateEditExistingActionConditionForLocking
def testAddOnFormUnloadRegistrationJS
def testAddOnFormUnloadRegistrationJSTwice
def testAddRAMCache
def testMoveKupuAndCMFPWControlPanel
def testMoveKupuAndCMFPWControlPanelTwice
def testMoveKupuAndCMFPWControlPanelNoTool
def testUpdateLanguageControlPanel
def testUpdateLanguageControlPanelTwice
def testUpdateLanguageControlPanelNoTool
def testUpdateTopicTitle
def testUpdateTopicTitleTwice
def testUpdateTopicTitleNoTool
def testAddIntelligentText
def testInstallNewModifiers
def testInstallNewModifiersTwice
def testInstallNewModifiersDoesNotStompChanges
def testInstallNewModifiersNoTool
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
 cp
 icons
 skins
 types
 workflow
 properties

Detailed Description

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

01325 
01326     def afterSetUp(self):
01327         self.actions = self.portal.portal_actions
01328         self.cp = self.portal.portal_controlpanel
01329         self.icons = self.portal.portal_actionicons
01330         self.skins = self.portal.portal_skins
01331         self.types = self.portal.portal_types
01332         self.workflow = self.portal.portal_workflow
01333         self.properties = self.portal.portal_properties
01334         self.cp = self.portal.portal_controlpanel

def CMFPlone.tests.testMigrations.TestMigrations_v3_0.disableSite (   self,
  obj,
  iface = ISite 
)

Definition at line 1335 of file testMigrations.py.

01335 
01336     def disableSite(self, obj, iface=ISite):
01337         # We need our own disableSite method as the CMF portal implements
01338         # ISite directly, so we cannot remove it, like the disableSite method
01339         # in Five.component would have done
01340         from ZPublisher.BeforeTraverse import unregisterBeforeTraverse
01341         from Products.Five.component import HOOK_NAME
01342 
01343         obj = aq_base(obj)
01344         if not iface.providedBy(obj):
01345             raise TypeError('Object must be a site.')
01346 
01347         unregisterBeforeTraverse(obj, HOOK_NAME)
01348         if hasattr(obj, HOOK_NAME):
01349             delattr(obj, HOOK_NAME)

Here is the caller graph for this function:

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

02859 
02860     def testAddBeta2VersioningPermissionsToNewRoles(self):
02861         # This migration just uses GS to apply the role changes,
02862         # these permissions will not have been installed previously,
02863         # so this should be safe
02864         for p in ['CMFEditions: Apply version control',
02865                   'CMFEditions: Save new version',
02866                   'CMFEditions: Access previous versions',
02867                   'CMFEditions: Revert to previous versions',
02868                   'CMFEditions: Checkout to location']:
02869             self.portal.manage_permission(p, ['Manager', 'Owner'], True)
02870         loadMigrationProfile(self.portal,
02871                 'profile-Products.CMFPlone.migrations:3.0b1-3.0b2',
02872                 steps=["rolemap"])
02873         for p in ['CMFEditions: Apply version control',
02874                   'CMFEditions: Save new version',
02875                   'CMFEditions: Access previous versions']:
02876             self.failUnless(p in [r['name'] for r in 
02877                                 self.portal.permissionsOfRole('Contributor') if r['selected']])
02878             self.failUnless(p in [r['name'] for r in 
02879                                 self.portal.permissionsOfRole('Editor') if r['selected']])
02880         for p in ['CMFEditions: Revert to previous versions',
02881                   'CMFEditions: Checkout to location']:
02882             self.failUnless(p in [r['name'] for r in 
02883                                 self.portal.permissionsOfRole('Editor') if r['selected']])
02884         # perform migration twice
02885         loadMigrationProfile(self.portal,
02886                 'profile-Products.CMFPlone.migrations:3.0b1-3.0b2',
02887                 steps=["rolemap"])
02888         for p in ['CMFEditions: Apply version control',
02889                   'CMFEditions: Save new version',
02890                   'CMFEditions: Access previous versions']:
02891             self.failUnless(p in [r['name'] for r in 
02892                                 self.portal.permissionsOfRole('Contributor') if r['selected']])
02893             self.failUnless(p in [r['name'] for r in 
02894                                 self.portal.permissionsOfRole('Editor') if r['selected']])
02895         for p in ['CMFEditions: Revert to previous versions',
02896                   'CMFEditions: Checkout to location']:
02897             self.failUnless(p in [r['name'] for r in 
02898                                 self.portal.permissionsOfRole('Editor') if r['selected']])

Here is the call graph for this function:

Definition at line 2800 of file testMigrations.py.

02800 
02801     def testAddCacheForKSSRegistry(self):
02802         ram_cache_id = 'ResourceRegistryCache'
02803         kssreg = self.portal.portal_kss
02804         kssreg.ZCacheable_setEnabled(0)
02805         kssreg.ZCacheable_setManagerId(None)
02806         self.failIf(kssreg.ZCacheable_enabled())
02807         self.failUnless(kssreg.ZCacheable_getManagerId() is None)
02808         # migrate
02809         addCacheForKSSRegistry(self.portal, [])
02810         # and test
02811         self.failUnless(kssreg.ZCacheable_enabled())
02812         self.failIf(kssreg.ZCacheable_getManagerId() is None)

Here is the call graph for this function:

Definition at line 2453 of file testMigrations.py.

02453 
02454     def testAddCacheForResourceRegistry(self):
02455         ram_cache_id = 'ResourceRegistryCache'
02456         # first remove the cache manager and make sure it's removed
02457         self.portal._delObject(ram_cache_id)
02458         self.failIf(ram_cache_id in self.portal.objectIds())
02459         cssreg = self.portal.portal_css
02460         cssreg.ZCacheable_setEnabled(0)
02461         cssreg.ZCacheable_setManagerId(None)
02462         self.failIf(cssreg.ZCacheable_enabled())
02463         self.failUnless(cssreg.ZCacheable_getManagerId() is None)
02464         jsreg = self.portal.portal_javascripts
02465         jsreg.ZCacheable_setEnabled(0)
02466         jsreg.ZCacheable_setManagerId(None)
02467         self.failIf(jsreg.ZCacheable_enabled())
02468         self.failUnless(jsreg.ZCacheable_getManagerId() is None)
02469         # then migrate
02470         addCacheForResourceRegistry(self.portal, [])
02471         # and test
02472         self.failUnless(ram_cache_id in self.portal.objectIds())
02473         self.failUnless(cssreg.ZCacheable_enabled())
02474         self.failIf(cssreg.ZCacheable_getManagerId() is None)
02475         self.failUnless(jsreg.ZCacheable_enabled())
02476         self.failIf(jsreg.ZCacheable_getManagerId() is None)

Here is the call graph for this function:

Definition at line 1814 of file testMigrations.py.

01814 
01815     def testAddCalendarConfiglet(self):
01816         self.removeActionFromTool('CalendarSettings', action_provider='portal_controlpanel')
01817         addCalendarConfiglet(self.portal, [])
01818         self.failUnless('CalendarSettings' in [x.getId() for x in self.cp.listActions()])
01819         cal = self.cp.getActionObject('Plone/CalendarSettings')
01820         self.assertEquals(cal.title, 'Calendar')
01821         self.assertEquals(cal.action.text,
01822                           'string:${portal_url}/@@calendar-controlpanel')
    

Here is the call graph for this function:

Definition at line 1834 of file testMigrations.py.

01834 
01835     def testAddCalendarConfigletNoTool(self):
01836         # Should not fail if tool is missing
01837         self.portal._delObject('portal_controlpanel')
01838         addCalendarConfiglet(self.portal, [])

Here is the call graph for this function:

Definition at line 1823 of file testMigrations.py.

01823 
01824     def testAddCalendarConfigletTwice(self):
01825         # Should not fail if done twice
01826         self.removeActionFromTool('CalendarSettings', action_provider='portal_controlpanel')
01827         addCalendarConfiglet(self.portal, [])
01828         addCalendarConfiglet(self.portal, [])
01829         self.failUnless('CalendarSettings' in [x.getId() for x in self.cp.listActions()])
01830         cal = self.cp.getActionObject('Plone/CalendarSettings')
01831         self.assertEquals(cal.title, 'Calendar')
01832         self.assertEquals(cal.action.text,
01833                           'string:${portal_url}/@@calendar-controlpanel')
    

Here is the call graph for this function:

Definition at line 2005 of file testMigrations.py.

02005 
02006     def testAddContentRulesAction(self):
02007         self.portal.portal_actions.object._delObject('contentrules')
02008         addContentRulesAction(self.portal, [])
02009         self.failUnless('contentrules' in self.portal.portal_actions.object.objectIds())
        

Here is the call graph for this function:

Definition at line 2020 of file testMigrations.py.

02020 
02021     def testAddContentRulesActionNoCategory(self):
02022         self.portal.portal_actions._delOb('object')
02023         addContentRulesAction(self.portal, [])
        

Here is the call graph for this function:

Definition at line 2016 of file testMigrations.py.

02016 
02017     def testAddContentRulesActionNoTool(self):
02018         self.portal._delOb('portal_actions')
02019         addContentRulesAction(self.portal, [])
        

Here is the call graph for this function:

Definition at line 2010 of file testMigrations.py.

02010 
02011     def testAddContentRulesActionTwice(self):
02012         self.portal.portal_actions.object._delOb('contentrules')
02013         addContentRulesAction(self.portal, [])
02014         addContentRulesAction(self.portal, [])
02015         self.failUnless('contentrules' in self.portal.portal_actions.object.objectIds())
        

Here is the call graph for this function:

Definition at line 2813 of file testMigrations.py.

02813 
02814     def testAddContributorToCreationPermissions(self):
02815         self.portal._delRoles(['Contributor',])
02816         for p in ['Add portal content', 'Add portal folders', 'ATContentTypes: Add Document',
02817                     'ATContentTypes: Add Event', 'ATContentTypes: Add Favorite',
02818                     'ATContentTypes: Add File', 'ATContentTypes: Add Folder', 
02819                     'ATContentTypes: Add Image', 'ATContentTypes: Add Large Plone Folder',
02820                     'ATContentTypes: Add Link', 'ATContentTypes: Add News Item', ]:
02821             self.portal.manage_permission(p, ['Manager', 'Owner'], True)
02822         addContributorToCreationPermissions(self.portal, [])
02823         self.failUnless('Contributor' in self.portal.valid_roles())
02824         self.failUnless('Contributor' in self.portal.acl_users.portal_role_manager.listRoleIds())
02825         for p in ['Add portal content', 'Add portal folders', 'ATContentTypes: Add Document',
02826                     'ATContentTypes: Add Event', 'ATContentTypes: Add Favorite',
02827                     'ATContentTypes: Add File', 'ATContentTypes: Add Folder', 
02828                     'ATContentTypes: Add Image', 'ATContentTypes: Add Large Plone Folder',
02829                     'ATContentTypes: Add Link', 'ATContentTypes: Add News Item', ]:
02830             self.failUnless(p in [r['name'] for r in 
02831                                 self.portal.permissionsOfRole('Contributor') if r['selected']])

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2922 of file testMigrations.py.

02922 
02923     def testAddContributorToCreationPermissions(self):
02924         for p in ['Manage properties', 'Modify view template', 'Request review']:
02925             self.portal.manage_permission(p, ['Manager', 'Owner'], True)
02926         addEditorToSecondaryEditorPermissions(self.portal, [])
02927         for p in ['Manage properties', 'Modify view template', 'Request review']:
02928             self.failUnless(p in [r['name'] for r in 
02929                 self.portal.permissionsOfRole('Editor') if r['selected']])

Here is the call graph for this function:

Definition at line 1440 of file testMigrations.py.

01440 
01441     def testAddDefaultAndForbiddenContentTypesProperties(self):
01442         # Should add the forbidden_contenttypes and default_contenttype property
01443         self.removeSiteProperty('forbidden_contenttypes')
01444         self.removeSiteProperty('default_contenttype')
01445         self.failIf(self.properties.site_properties.hasProperty('forbidden_contenttypes'))
01446         self.failIf(self.properties.site_properties.hasProperty('default_contenttype'))
01447         addDefaultAndForbiddenContentTypesProperties(self.portal, [])
01448         self.failUnless(self.properties.site_properties.hasProperty('forbidden_contenttypes'))
01449         self.failUnless(self.properties.site_properties.hasProperty('default_contenttype'))
01450         self.failUnless(self.properties.site_properties.forbidden_contenttypes == ( 
01451             'text/structured',
01452             'text/x-rst',
01453             'text/plain-pre',
01454             'text/x-python',
01455             'text/x-web-markdown',
01456             'text/x-web-textile',
01457             'text/x-web-intelligent')
01458         )

Here is the call graph for this function:

Definition at line 1459 of file testMigrations.py.

01459 
01460     def testAddDefaultAndForbiddenContentTypesPropertiesTwice(self):
01461         # Should not fail if migrated again
01462         self.removeSiteProperty('forbidden_contenttypes')
01463         self.removeSiteProperty('default_contenttype')
01464         self.failIf(self.properties.site_properties.hasProperty('forbidden_contenttypes'))
01465         self.failIf(self.properties.site_properties.hasProperty('default_contenttype'))
01466         addDefaultAndForbiddenContentTypesProperties(self.portal, [])
01467         self.failUnless(self.properties.site_properties.forbidden_contenttypes == ( 
01468             'text/structured',
01469             'text/x-rst',
01470             'text/plain-pre',
01471             'text/x-python',
01472             'text/x-web-markdown',
01473             'text/x-web-textile',
01474             'text/x-web-intelligent')
01475         )
01476         self.properties.site_properties.forbidden_contenttypes = ('text/x-rst',)
01477         addDefaultAndForbiddenContentTypesProperties(self.portal, [])
01478         self.failUnless(self.properties.site_properties.hasProperty('forbidden_contenttypes'))
01479         self.failUnless(self.properties.site_properties.hasProperty('default_contenttype'))
01480         # adding a second time should leave existing `forbidden_contenttypes` settings alone:
01481         self.failUnless(self.properties.site_properties.forbidden_contenttypes == ( 
01482             'text/x-rst', 
01483             )
01484         )
        

Here is the call graph for this function:

Definition at line 2832 of file testMigrations.py.

02832 
02833     def testAddEditorToCreationPermissionsNoStomp(self):
02834         self.portal.manage_permission('Add portal content', ['Manager'], False)
02835         addContributorToCreationPermissions(self.portal, [])
02836         roles = sorted([r['name'] for r in self.portal.rolesOfPermission('Add portal content') if r['selected']])
02837         self.assertEquals(['Contributor', 'Manager'], roles)
02838         self.assertEquals(False, bool(self.portal.acquiredRolesAreUsedBy('Add portal content')))
                                

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2930 of file testMigrations.py.

02930 
02931     def testAddEditorToCreationPermissionsNoStomp(self):
02932         self.portal.manage_permission('Manage properties', ['Manager'], False)
02933         addEditorToSecondaryEditorPermissions(self.portal, [])
02934         roles = sorted([r['name'] for r in self.portal.rolesOfPermission('Manage properties') if r['selected']])
02935         self.assertEquals(['Editor', 'Manager'], roles)
02936         self.assertEquals(False, bool(self.portal.acquiredRolesAreUsedBy('Manage properties')))
                                

Here is the call graph for this function:

Definition at line 2839 of file testMigrations.py.

02839 
02840     def testAddEditorToCreationPermissionsTwice(self):
02841         self.portal._delRoles(['Contributor',])
02842         for p in ['Add portal content', 'Add portal folders', 'ATContentTypes: Add Document',
02843                     'ATContentTypes: Add Event', 'ATContentTypes: Add Favorite',
02844                     'ATContentTypes: Add File', 'ATContentTypes: Add Folder', 
02845                     'ATContentTypes: Add Image', 'ATContentTypes: Add Large Plone Folder',
02846                     'ATContentTypes: Add Link', 'ATContentTypes: Add News Item', ]:
02847             self.portal.manage_permission(p, ['Manager', 'Owner'], True)
02848         addContributorToCreationPermissions(self.portal, [])
02849         addContributorToCreationPermissions(self.portal, [])
02850         self.failUnless('Contributor' in self.portal.valid_roles())
02851         self.failUnless('Contributor' in self.portal.acl_users.portal_role_manager.listRoleIds())
02852         for p in ['Add portal content', 'Add portal folders', 'ATContentTypes: Add Document',
02853                     'ATContentTypes: Add Event', 'ATContentTypes: Add Favorite',
02854                     'ATContentTypes: Add File', 'ATContentTypes: Add Folder', 
02855                     'ATContentTypes: Add Image', 'ATContentTypes: Add Large Plone Folder',
02856                     'ATContentTypes: Add Link', 'ATContentTypes: Add News Item', ]:
02857             self.failUnless(p in [r['name'] for r in 
02858                                 self.portal.permissionsOfRole('Contributor') if r['selected']])

Here is the call graph for this function:

Definition at line 2937 of file testMigrations.py.

02937 
02938     def testAddEditorToSecondaryEditPermissionsTwice(self):
02939         for p in ['Manage properties', 'Modify view template', 'Request review']:
02940             self.portal.manage_permission(p, ['Manager', 'Owner'], True)
02941         addEditorToSecondaryEditorPermissions(self.portal, [])
02942         addEditorToSecondaryEditorPermissions(self.portal, [])
02943         for p in ['Manage properties', 'Modify view template', 'Request review']:
02944             self.failUnless(p in [r['name'] for r in 
02945                 self.portal.permissionsOfRole('Editor') if r['selected']])

Here is the call graph for this function:

Definition at line 2637 of file testMigrations.py.

02637 
02638     def testAddEmailCharsetProperty(self):
02639         if self.portal.hasProperty('email_charset'):
02640             self.portal.manage_delProperties(['email_charset'])
02641         addEmailCharsetProperty(self.portal, [])
02642         self.failUnless(self.portal.hasProperty('email_charset'))
02643         self.assertEquals(self.portal.getProperty('email_charset'), 'utf-8')

Here is the call graph for this function:

Definition at line 2644 of file testMigrations.py.

02644 
02645     def testAddEmailCharsetPropertyTwice(self):
02646         out = []
02647         if self.portal.hasProperty('email_charset'):
02648             self.portal.manage_delProperties(['email_charset'])
02649         addEmailCharsetProperty(self.portal, out)
02650         addEmailCharsetProperty(self.portal, out)
02651         self.failUnless(self.portal.hasProperty('email_charset'))
02652         self.assertEquals(self.portal.getProperty('email_charset'), 'utf-8')

Here is the call graph for this function:

Definition at line 2566 of file testMigrations.py.

02566 
02567     def testAddExternalLinksOpenNewWindowProperty(self):
02568         # adds a site property to portal_properties
02569         tool = self.portal.portal_properties
02570         sheet = tool.site_properties
02571         self.removeSiteProperty('external_links_open_new_window')
02572         addExternalLinksOpenNewWindowProperty(self.portal, [])
02573         self.failUnless(sheet.hasProperty('external_links_open_new_window'))
02574         self.failUnless(sheet.external_links_open_new_window == 'false')
02575         # Test migrations succeeds if run multiple times
02576         self.removeSiteProperty('external_links_open_new_window')
02577         addExternalLinksOpenNewWindowProperty(self.portal, [])
02578         addExternalLinksOpenNewWindowProperty(self.portal, [])
02579         self.failUnless(sheet.hasProperty('external_links_open_new_window'))
02580         self.failUnless(sheet.external_links_open_new_window == 'false')

Here is the call graph for this function:

Definition at line 2375 of file testMigrations.py.

02375 
02376     def testAddFilterAndSecurityConfiglets(self):
02377         self.removeActionFromTool('HtmlFilter', action_provider='portal_controlpanel')
02378         self.removeActionFromTool('SecuritySettings', action_provider='portal_controlpanel')
02379         addFilterAndSecurityConfiglets(self.portal, [])
02380         self.failUnless('HtmlFilter' in [x.getId() for x in self.cp.listActions()])
02381         self.failUnless('SecuritySettings' in [x.getId() for x in self.cp.listActions()])
02382         htmlfilter = self.cp.getActionObject('Plone/HtmlFilter')
02383         self.assertEquals(htmlfilter.title, 'HTML Filtering')
02384         self.assertEquals(htmlfilter.action.text,
02385                           'string:${portal_url}/@@filter-controlpanel')
02386         security = self.cp.getActionObject('Plone/SecuritySettings')
02387         self.assertEquals(security.title, 'Security')
02388         self.assertEquals(security.action.text,
02389                           'string:${portal_url}/@@security-controlpanel')

Here is the call graph for this function:

Definition at line 2407 of file testMigrations.py.

02407 
02408     def testAddFilterAndSecurityConfigletsNoTool(self):
02409         # Should not fail if tool is missing
02410         self.portal._delObject('portal_controlpanel')
02411         addFilterAndSecurityConfiglets(self.portal, [])

Here is the call graph for this function:

Definition at line 2390 of file testMigrations.py.

02390 
02391     def testAddFilterAndSecurityConfigletsTwice(self):
02392         # Should not fail if done twice
02393         self.removeActionFromTool('HtmlFilter', action_provider='portal_controlpanel')
02394         self.removeActionFromTool('SecuritySettings', action_provider='portal_controlpanel')
02395         addFilterAndSecurityConfiglets(self.portal, [])
02396         addFilterAndSecurityConfiglets(self.portal, [])
02397         self.failUnless('HtmlFilter' in [x.getId() for x in self.cp.listActions()])
02398         self.failUnless('SecuritySettings' in [x.getId() for x in self.cp.listActions()])
02399         htmlfilter = self.cp.getActionObject('Plone/HtmlFilter')
02400         self.assertEquals(htmlfilter.title, 'HTML Filtering')
02401         self.assertEquals(htmlfilter.action.text,
02402                           'string:${portal_url}/@@filter-controlpanel')
02403         security = self.cp.getActionObject('Plone/SecuritySettings')
02404         self.assertEquals(security.title, 'Security')
02405         self.assertEquals(security.action.text,
02406                           'string:${portal_url}/@@security-controlpanel')

Here is the call graph for this function:

Definition at line 1574 of file testMigrations.py.

01574 
01575     def testAddFormInputLabelJS(self):
01576         jsreg = self.portal.portal_javascripts
01577         # unregister first
01578         jsreg.unregisterResource('input-label.js')
01579         script_ids = jsreg.getResourceIds()
01580         self.failIf('input-label.js' in script_ids)
01581         # migrate and test again
01582         addFormInputLabelJS(self.portal, [])
01583         script_ids = jsreg.getResourceIds()
01584         self.failUnless('input-label.js' in script_ids)

Here is the call graph for this function:

Definition at line 1557 of file testMigrations.py.

01557 
01558     def testAddFormTabbingJS(self):
01559         jsreg = self.portal.portal_javascripts
01560         # unregister first
01561         jsreg.unregisterResource('form_tabbing.js')
01562         script_ids = jsreg.getResourceIds()
01563         self.failIf('form_tabbing.js' in script_ids)
01564         # migrate and test again
01565         addFormTabbingJS(self.portal, [])
01566         script_ids = jsreg.getResourceIds()
01567         self.failUnless('form_tabbing.js' in script_ids)
01568         # if collapsiblesections.js is available form_tabbing.js
01569         # should be positioned right underneath it
01570         if 'collapsiblesections.js' in script_ids:
01571             posSE = jsreg.getResourcePosition('form_tabbing.js')
01572             posHST = jsreg.getResourcePosition('collapsiblesections.js')
01573             self.failUnless((posSE - 1) == posHST)

Here is the call graph for this function:

Definition at line 1796 of file testMigrations.py.

01796 
01797     def testAddIconForCalendarSettingsConfiglet(self):
01798         # Should add the calendar action icon
01799         self.removeActionIconFromTool('CalendarSettings')
01800         addIconForCalendarSettingsConfiglet(self.portal, [])
01801         self.failUnless('CalendarSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 1809 of file testMigrations.py.

01809 
01810     def testAddIconForCalendarSettingsConfigletNoTool(self):
01811         # Should not fail if portal_actionicons is missing
01812         self.portal._delObject('portal_actionicons')
01813         addIconForCalendarSettingsConfiglet(self.portal, [])

Here is the call graph for this function:

Definition at line 1802 of file testMigrations.py.

01802 
01803     def testAddIconForCalendarSettingsConfigletTwice(self):
01804         # Should not fail if migrated again
01805         self.removeActionIconFromTool('CalendarSettings')
01806         addIconForCalendarSettingsConfiglet(self.portal, [])
01807         addIconForCalendarSettingsConfiglet(self.portal, [])
01808         self.failUnless('CalendarSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 2167 of file testMigrations.py.

02167 
02168     def testAddIconForMaintenanceConfiglet(self):
02169         # Should add the maintenance action icon
02170         self.removeActionIconFromTool('Maintenance')
02171         addIconForCalendarSettingsConfiglet(self.portal, [])
02172         self.failUnless('Maintenance' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 2173 of file testMigrations.py.

02173 
02174     def testAddIconForMaintenanceConfigletTwice(self):
02175         # Should add the maintenance action icon
02176         self.removeActionIconFromTool('Maintenance')
02177         addIconForCalendarSettingsConfiglet(self.portal, [])
02178         addIconForCalendarSettingsConfiglet(self.portal, [])
02179         self.failUnless('Maintenance' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 1485 of file testMigrations.py.

01485 
01486     def testAddIconForMarkupConfiglet(self):
01487         self.removeActionIconFromTool('MarkupSettings')
01488         addIconForMarkupConfiglet(self.portal, [])
01489         self.failUnless('MarkupSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 1496 of file testMigrations.py.

01496 
01497     def testAddIconForMarkupConfigletNoTool(self):
01498         self.portal._delObject('portal_actionicons')
01499         addIconForMarkupConfiglet(self.portal, [])
    

Here is the call graph for this function:

Definition at line 1490 of file testMigrations.py.

01490 
01491     def testAddIconForMarkupConfigletTwice(self):
01492         self.removeActionIconFromTool('MarkupSettings')
01493         addIconForMarkupConfiglet(self.portal, [])
01494         addIconForMarkupConfiglet(self.portal, [])
01495         self.failUnless('MarkupSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 1521 of file testMigrations.py.

01521 
01522     def testAddIconForTypesConfiglet(self):
01523         self.removeActionIconFromTool('TypesSettings')
01524         addIconForTypesConfiglet(self.portal, [])
01525         self.failUnless('TypesSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 1532 of file testMigrations.py.

01532 
01533     def testAddIconForTypesConfigletNoTool(self):
01534         self.portal._delObject('portal_actionicons')
01535         addIconForTypesConfiglet(self.portal, [])      
                          

Here is the call graph for this function:

Definition at line 1526 of file testMigrations.py.

01526 
01527     def testAddIconForTypesConfigletTwice(self):
01528         self.removeActionIconFromTool('TypesSettings')
01529         addIconForTypesConfiglet(self.portal, [])
01530         addIconForTypesConfiglet(self.portal, [])
01531         self.failUnless('TypesSettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 2541 of file testMigrations.py.

02541 
02542     def testaddIconsForFilterAndSecurityConfiglets(self):
02543         # Should add the filter and security action icons
02544         self.removeActionIconFromTool('HtmlFilter')
02545         self.removeActionIconFromTool('SecuritySettings')
02546         addIconsForFilterAndSecurityConfiglets(self.portal, [])
02547         self.failUnless('HtmlFilter' in [x.getActionId() for x in self.icons.listActionIcons()])
02548         self.failUnless('SecuritySettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 2370 of file testMigrations.py.

02370 
02371     def testaddIconsForFilterAndSecurityConfigletsNoTool(self):
02372         # Should not fail if portal_actionicons is missing
02373         self.portal._delObject('portal_actionicons')
02374         addIconsForFilterAndSecurityConfiglets(self.portal, [])

Here is the call graph for this function:

Definition at line 2549 of file testMigrations.py.

02549 
02550     def testaddIconsForFilterAndSecurityConfigletsTwice(self):
02551         # Should not fail if migrated again
02552         self.removeActionIconFromTool('HtmlFilter')
02553         self.removeActionIconFromTool('SecuritySettings')
02554         addIconsForFilterAndSecurityConfiglets(self.portal, [])
02555         addIconsForFilterAndSecurityConfiglets(self.portal, [])
02556         self.failUnless('HtmlFilter' in [x.getActionId() for x in self.icons.listActionIcons()])
02557         self.failUnless('SecuritySettings' in [x.getActionId() for x in self.icons.listActionIcons()])

Here is the call graph for this function:

Definition at line 2196 of file testMigrations.py.

02196 
02197     def testAddInlineEditingSwitch(self):
02198         # adds a site property to portal_properties
02199         self.removeSiteProperty('enable_inline_editing')
02200         loadMigrationProfile(self.portal,
02201                 'profile-Products.CMFPlone.migrations:3.1.3-3.1.4',
02202                 steps=["propertiestool"])
02203         tool = self.portal.portal_properties
02204         sheet = tool.site_properties
02205         self.failUnless(sheet.hasProperty('enable_inline_editing'))
    

Here is the call graph for this function:

Definition at line 3102 of file testMigrations.py.

03102 
03103     def testAddIntelligentText(self):
03104         # Before migration, the mime type and transforms of
03105         # intelligent text are not available.  They *are* here in a
03106         # fresh site, so we may need to remove them first for testing.
03107 
03108         # First we remove the transforms, as they depend on the
03109         # mimetype being there.
03110         missing_transforms = ["web_intelligent_plain_text_to_html",
03111                               "html_to_web_intelligent_plain_text"]
03112         ptr = self.portal.portal_transforms
03113         current_transforms = ptr.objectIds()
03114         for trans in missing_transforms:
03115             if trans in current_transforms:
03116                 ptr.unregisterTransform(trans)
03117 
03118         # Then we remove the mime type
03119         mime_type = 'text/x-web-intelligent'
03120         mtr = self.portal.mimetypes_registry
03121         current_types = mtr.list_mimetypes()
03122         if mime_type in current_types:
03123             mtr.manage_delObjects((mime_type,))
03124 
03125         # now all are gone:
03126         self.failIf(mime_type in mtr.list_mimetypes())
03127         self.failIf(set(ptr.objectIds()).issuperset(set(missing_transforms)))
03128 
03129         out = []
03130         addIntelligentText(self.portal, out)
03131         # now all are back:
03132         self.failUnless(mime_type in mtr.list_mimetypes())
03133         self.failUnless(set(ptr.objectIds()).issuperset(set(missing_transforms)))

Here is the call graph for this function:

Definition at line 2188 of file testMigrations.py.

02188 
02189     def testAddLinkIntegritySwitch(self):
02190         # adds a site property to portal_properties
02191         self.removeSiteProperty('enable_link_integrity_checks')
02192         addLinkIntegritySwitch(self.portal, [])
02193         tool = self.portal.portal_properties
02194         sheet = tool.site_properties
02195         self.failUnless(sheet.hasProperty('enable_link_integrity_checks'))
    

Here is the call graph for this function:

Definition at line 2148 of file testMigrations.py.

02148 
02149     def testAddMaintenanceConfiglet(self):
02150         self.removeActionFromTool('Maintenance', action_provider='portal_controlpanel')
02151         addMaintenanceConfiglet(self.portal, [])
02152         self.failUnless('Maintenance' in [x.getId() for x in self.cp.listActions()])
02153         main = self.cp.getActionObject('Plone/Maintenance')
02154         self.assertEquals(main.title, 'Maintenance')
02155         self.assertEquals(main.action.text,
02156                           'string:${portal_url}/@@maintenance-controlpanel')

Here is the call graph for this function:

Definition at line 2157 of file testMigrations.py.

02157 
02158     def testAddMaintenanceConfigletTwice(self):
02159         self.removeActionFromTool('Maintenance', action_provider='portal_controlpanel')
02160         addMaintenanceConfiglet(self.portal, [])
02161         addMaintenanceConfiglet(self.portal, [])
02162         self.failUnless('Maintenance' in [x.getId() for x in self.cp.listActions()])
02163         main = self.cp.getActionObject('Plone/Maintenance')
02164         self.assertEquals(main.title, 'Maintenance')
02165         self.assertEquals(main.action.text,
02166                           'string:${portal_url}/@@maintenance-controlpanel')

Here is the call graph for this function:

Definition at line 2180 of file testMigrations.py.

02180 
02181     def testAddMaintenanceProperty(self):
02182         # adds a site property to portal_properties
02183         self.removeSiteProperty('number_of_days_to_keep')
02184         addMaintenanceProperty(self.portal, [])
02185         tool = self.portal.portal_properties
02186         sheet = tool.site_properties
02187         self.failUnless(sheet.hasProperty('number_of_days_to_keep'))
    

Here is the call graph for this function:

Definition at line 2585 of file testMigrations.py.

02585 
02586     def testAddManyGroupsProperty(self):
02587         # adds a site property to portal_properties
02588         tool = self.portal.portal_properties
02589         sheet = tool.site_properties
02590         self.removeSiteProperty('many_groups')
02591         addManyGroupsProperty(self.portal, [])
02592         self.failUnless(sheet.hasProperty('many_groups'))
02593         self.failUnless(sheet.many_groups == False)
02594         # Test migrations succeeds if run multiple times
02595         self.removeSiteProperty('many_groups')
02596         addManyGroupsProperty(self.portal, [])
02597         addManyGroupsProperty(self.portal, [])
02598         self.failUnless(sheet.hasProperty('many_groups'))
02599         self.failUnless(sheet.many_groups == False)

Here is the call graph for this function:

Definition at line 1500 of file testMigrations.py.

01500 
01501     def testAddMarkupConfiglet(self):
01502         self.removeActionFromTool('MarkupSettings', action_provider='portal_controlpanel')
01503         addMarkupConfiglet(self.portal, [])
01504         self.failUnless('MarkupSettings' in [action.getId() for action in self.cp.listActions()])
01505         types = self.cp.getActionObject('Plone/MarkupSettings')
01506         self.assertEquals(types.action.text,
01507                           'string:${portal_url}/@@markup-controlpanel')

Here is the call graph for this function:

Definition at line 1517 of file testMigrations.py.

01517 
01518     def testAddMarkupConfigletNoTool(self):
01519         self.portal._delObject('portal_controlpanel')
01520         addMarkupConfiglet(self.portal, [])
                              

Here is the call graph for this function:

Definition at line 1508 of file testMigrations.py.

01508 
01509     def testAddMarkupConfigletTwice(self):
01510         self.removeActionFromTool('MarkupSettings', action_provider='portal_controlpanel')
01511         addMarkupConfiglet(self.portal, [])
01512         addMarkupConfiglet(self.portal, [])
01513         self.failUnless('MarkupSettings' in [action.getId() for action in self.cp.listActions()])
01514         types = self.cp.getActionObject('Plone/MarkupSettings')
01515         self.assertEquals(types.action.text,
01516                           'string:${portal_url}/@@markup-controlpanel')
                          

Here is the call graph for this function:

Definition at line 2581 of file testMigrations.py.

02581 
02582     def testAddMissingWorkflowsNoTool(self):
02583         self.portal._delObject('portal_workflow')
02584         addMissingWorkflows(self.portal, [])

Here is the call graph for this function:

Definition at line 1419 of file testMigrations.py.

01419 
01420     def testAddNewBeta2CSSFiles(self):
01421         cssreg = self.portal.portal_css
01422         added_ids = ['controlpanel.css']
01423         for id in added_ids:
01424             cssreg.unregisterResource(id)
01425         stylesheet_ids = cssreg.getResourceIds()
01426         for id in added_ids:
01427             self.failIf('controlpanel.css' in stylesheet_ids)
01428         loadMigrationProfile(self.portal,
01429                 'profile-Products.CMFPlone.migrations:3.0b1-3.0b2',
01430                 steps=["cssregistry"])
01431         stylesheet_ids = cssreg.getResourceIds()
01432         for id in added_ids:
01433             self.failUnless(id in stylesheet_ids)
01434         # perform migration twice
01435         loadMigrationProfile(self.portal,
01436                 'profile-Products.CMFPlone.migrations:3.0b1-3.0b2',
01437                 steps=["cssregistry"])
01438         for id in added_ids:
01439             self.failUnless(id in stylesheet_ids)

Here is the call graph for this function:

Definition at line 1402 of file testMigrations.py.

01402 
01403     def testAddNewCSSFiles(self):
01404         cssreg = self.portal.portal_css
01405         added_ids = ['navtree.css', 'invisibles.css', 'forms.css']
01406         for id in added_ids:
01407             cssreg.unregisterResource(id)
01408         stylesheet_ids = cssreg.getResourceIds()
01409         for id in added_ids:
01410             self.failIf('navtree.css' in stylesheet_ids)
01411         addNewCSSFiles(self.portal, [])
01412         stylesheet_ids = cssreg.getResourceIds()
01413         for id in added_ids:
01414             self.failUnless(id in stylesheet_ids)
01415         # perform migration twice
01416         addNewCSSFiles(self.portal, [])
01417         for id in added_ids:
01418             self.failUnless(id in stylesheet_ids)

Here is the call graph for this function:

Definition at line 2995 of file testMigrations.py.

02995 
02996     def testAddOnFormUnloadRegistrationJS(self):
02997         jsreg = self.portal.portal_javascripts
02998         # unregister first
02999         jsreg.unregisterResource('unlockOnFormUnload.js')
03000         script_ids = jsreg.getResourceIds()
03001         self.failIf('unlockOnFormUnload.js' in script_ids)
03002         # migrate and test again
03003         addOnFormUnloadJS(self.portal, [])
03004         script_ids = jsreg.getResourceIds()
03005         self.failUnless('unlockOnFormUnload.js' in script_ids)

Here is the call graph for this function:

Definition at line 3006 of file testMigrations.py.

03006 
03007     def testAddOnFormUnloadRegistrationJSTwice(self):
03008         jsreg = self.portal.portal_javascripts
03009         # unregister first
03010         jsreg.unregisterResource('unlockOnFormUnload.js')
03011         script_ids = jsreg.getResourceIds()
03012         self.failIf('unlockOnFormUnload.js' in script_ids)
03013         # migrate and test again
03014         addOnFormUnloadJS(self.portal, [])
03015         addOnFormUnloadJS(self.portal, [])
03016         script_ids = jsreg.getResourceIds()
03017         self.failUnless('unlockOnFormUnload.js' in script_ids)

Here is the call graph for this function:

Definition at line 3018 of file testMigrations.py.

03018 
03019     def testAddRAMCache(self):
03020         sm = getSiteManager()
03021         sm.unregisterUtility(provided=IRAMCache)
03022         util = queryUtility(IRAMCache)
03023         self.failUnless(util.maxAge == 86400)
03024         beta3_rc1(self.portal)
03025         util = queryUtility(IRAMCache)
03026         self.failUnless(util.maxAge == 3600)

Here is the call graph for this function:

Definition at line 2024 of file testMigrations.py.

02024 
02025     def testAddReaderEditorRoles(self):
02026         self.portal._delRoles(['Reader', 'Editor'])
02027         addReaderAndEditorRoles(self.portal, [])
02028         self.failUnless('Reader' in self.portal.valid_roles())
02029         self.failUnless('Editor' in self.portal.valid_roles())
02030         self.failUnless('Reader' in self.portal.acl_users.portal_role_manager.listRoleIds())
02031         self.failUnless('Editor' in self.portal.acl_users.portal_role_manager.listRoleIds())
02032         self.failUnless('View' in [r['name'] for r in self.portal.permissionsOfRole('Reader') if r['selected']])
02033         self.failUnless('Modify portal content' in [r['name'] for r in self.portal.permissionsOfRole('Editor') if r['selected']])
        

Here is the call graph for this function:

Definition at line 2034 of file testMigrations.py.

02034 
02035     def testAddReaderEditorRolesPermissionOnly(self):
02036         self.portal.manage_permission('View', [], True)
02037         self.portal.manage_permission('Modify portal content', [], True)
02038         addReaderAndEditorRoles(self.portal, [])
02039         self.failUnless('Reader' in self.portal.valid_roles())
02040         self.failUnless('Editor' in self.portal.valid_roles())
02041         self.failUnless('Reader' in self.portal.acl_users.portal_role_manager.listRoleIds())
02042         self.failUnless('Editor' in self.portal.acl_users.portal_role_manager.listRoleIds())
02043         self.failUnless('View' in [r['name'] for r in self.portal.permissionsOfRole('Reader') if r['selected']])
02044         self.failUnless('Modify portal content' in [r['name'] for r in self.portal.permissionsOfRole('Editor') if r['selected']])
        

Here is the call graph for this function:

Definition at line 2045 of file testMigrations.py.

02045 
02046     def testAddReaderEditorRolesTwice(self):
02047         self.portal._delRoles(['Reader', 'Editor'])
02048         addReaderAndEditorRoles(self.portal, [])
02049         addReaderAndEditorRoles(self.portal, [])
02050         self.failUnless('Reader' in self.portal.valid_roles())
02051         self.failUnless('Editor' in self.portal.valid_roles())
02052         self.failUnless('Reader' in self.portal.acl_users.portal_role_manager.listRoleIds())
02053         self.failUnless('Editor' in self.portal.acl_users.portal_role_manager.listRoleIds())
02054         self.failUnless('View' in [r['name'] for r in self.portal.permissionsOfRole('Reader') if r['selected']])
02055         self.failUnless('Modify portal content' in [r['name'] for r in self.portal.permissionsOfRole('Editor') if r['selected']])

Here is the call graph for this function:

Definition at line 2412 of file testMigrations.py.

02412 
02413     def testAddSitemapProperty(self):
02414         self.removeSiteProperty('enable_sitemap')
02415         addSitemapProperty(self.portal, [])
02416         tool = self.portal.portal_properties
02417         sheet = tool.site_properties
02418         self.failUnless(sheet.hasProperty('enable_sitemap'))

Here is the call graph for this function:

Definition at line 2206 of file testMigrations.py.

02206 
02207     def testAddTableContents(self):
02208         css = self.portal.portal_css
02209         js = self.portal.portal_javascripts
02210         css.manage_removeStylesheet("toc.css")
02211         js.manage_removeScript("toc.js")
02212         addTableContents(self.portal, [])
02213         self.failUnless("toc.js" in js.getResourceIds())
02214         self.failUnless("toc.css" in css.getResourceIds())
02215         addTableContents(self.portal, [])
02216         self.failUnless("toc.js" in js.getResourceIds())
02217         self.failUnless("toc.css" in css.getResourceIds())
        

Here is the call graph for this function:

Definition at line 1536 of file testMigrations.py.

01536 
01537     def testAddTypesConfiglet(self):
01538         self.removeActionFromTool('TypesSettings', action_provider='portal_controlpanel')
01539         addTypesConfiglet(self.portal, [])
01540         self.failUnless('TypesSettings' in [action.getId() for action in self.cp.listActions()])
01541         types = self.cp.getActionObject('Plone/TypesSettings')
01542         self.assertEquals(types.action.text,
01543                           'string:${portal_url}/@@types-controlpanel')

Here is the call graph for this function:

Definition at line 1553 of file testMigrations.py.

01553 
01554     def testAddTypesConfigletNoTool(self):
01555         self.portal._delObject('portal_controlpanel')
01556         addTypesConfiglet(self.portal, [])

Here is the call graph for this function:

Definition at line 1544 of file testMigrations.py.

01544 
01545     def testAddTypesConfigletTwice(self):
01546         self.removeActionFromTool('TypesSettings', action_provider='portal_controlpanel')
01547         addTypesConfiglet(self.portal, [])
01548         addTypesConfiglet(self.portal, [])
01549         self.failUnless('TypesSettings' in [action.getId() for action in self.cp.listActions()])
01550         types = self.cp.getActionObject('Plone/TypesSettings')
01551         self.assertEquals(types.action.text,
01552                           'string:${portal_url}/@@types-controlpanel')

Here is the call graph for this function:

Definition at line 2503 of file testMigrations.py.

02503 
02504     def testAddWebstatsJS(self):
02505         jsreg = self.portal.portal_javascripts
02506         # unregister first
02507         jsreg.unregisterResource('webstats.js')
02508         script_ids = jsreg.getResourceIds()
02509         self.failIf('webstats.js' in script_ids)
02510         # migrate and test again
02511         addWebstatsJSFile(self.portal, [])
02512         script_ids = jsreg.getResourceIds()
02513         self.failUnless('webstats.js' in script_ids)
02514         if 'webstats.js' in script_ids:
02515             pos1 = jsreg.getResourcePosition('toc.js')
02516             pos2 = jsreg.getResourcePosition('webstats.js')
02517             self.failUnless((pos2 - 1) == pos1)
02518         # check if enabled
02519         res = jsreg.getResource('webstats.js')
02520         self.assertEqual(res.getEnabled(),True)

Here is the call graph for this function:

Definition at line 2495 of file testMigrations.py.

02495 
02496     def testAddWebstatsJSProperty(self):
02497         # adds a site property to portal_properties
02498         self.removeSiteProperty('webstats_js')
02499         addWebstatsJSProperty(self.portal, [])
02500         tool = self.portal.portal_properties
02501         sheet = tool.site_properties
02502         self.failUnless(sheet.hasProperty('webstats_js'))

Here is the call graph for this function:

Definition at line 2757 of file testMigrations.py.

02757 
02758     def testAutoGroupCreated(self):
02759         pas = self.portal.acl_users
02760         ids = pas.objectIds(['Automatic Group Plugin'])
02761         if ids:
02762             pas.manage_delObjects(ids)
02763         addAutoGroupToPAS(self.portal, [])
02764         self.assertEqual(pas.objectIds(['Automatic Group Plugin']),
02765                 ['auto_group'])
02766         plugin = pas.auto_group
02767         interfaces = [info['interface'] for info in pas.plugins.listPluginTypeInfo()]
02768         for iface in interfaces:
02769             if plugin.testImplements(iface):
02770                 self.failIf('auto_group' not in pas.plugins.listPluginIds(iface))
02771         self.assertEqual(len(pas.searchGroups(id='AuthenticatedUsers',
02772                                               exact_match=True)), 1)

Here is the call graph for this function:

Definition at line 2653 of file testMigrations.py.

02653 
02654     def testChangeOrderOfActionProviders(self):
02655         out = []
02656         self.actions.deleteActionProvider('portal_types')
02657         self.actions.addActionProvider('portal_types')
02658         self.assertEquals(
02659             self.actions.listActionProviders(),
02660             ('portal_workflow', 'portal_actions', 'portal_types'))
02661         changeOrderOfActionProviders(self.portal, out)
02662         self.assertEquals(
02663             self.actions.listActionProviders(),
02664             ('portal_workflow', 'portal_types', 'portal_actions'))

Here is the call graph for this function:

Definition at line 2665 of file testMigrations.py.

02665 
02666     def testChangeOrderOfActionProvidersTwice(self):
02667         out = []
02668         self.actions.deleteActionProvider('portal_types')
02669         self.actions.addActionProvider('portal_types')
02670         self.assertEquals(
02671             self.actions.listActionProviders(),
02672             ('portal_workflow', 'portal_actions', 'portal_types'))
02673         changeOrderOfActionProviders(self.portal, out)
02674         changeOrderOfActionProviders(self.portal, out)
02675         self.assertEquals(
02676             self.actions.listActionProviders(),
02677             ('portal_workflow', 'portal_types', 'portal_actions'))

Here is the call graph for this function:

Definition at line 2743 of file testMigrations.py.

02743 
02744     def testCharsetCleanup(self):
02745         if not self.portal.hasProperty('default_charset'):
02746             self.portal.manage_addProperty('default_charset', '', 'string')
02747 
02748         self.portal.manage_changeProperties(default_charset = 'latin1')
02749         cleanDefaultCharset(self.portal, [])
02750         self.assertEqual(self.portal.getProperty('default_charset', 'nothere'),
02751                 'latin1')
02752 
02753         self.portal.manage_changeProperties(default_charset = '')
02754         cleanDefaultCharset(self.portal, [])
02755         self.assertEqual(self.portal.getProperty('default_charset', 'nothere'),
02756                 'nothere')

Here is the call graph for this function:

Definition at line 2678 of file testMigrations.py.

02678 
02679     def testCleanupOldActions(self):
02680         out = []
02681         reply = Action('reply', title='Reply')
02682         logged_in = Action('logged_in', title='Logged in')
02683         change_ownership = Action('change_ownership', title='Change ownership')
02684 
02685         object_ = self.actions.object
02686         object_tabs = getattr(self.actions, 'object_tabs', None)
02687         if object_tabs is None:
02688             category = 'object_tabs'
02689             self.actions._setObject(category, ActionCategory(id=category))
02690             object_tabs = self.actions.object_tabs
02691         if getattr(self.actions, 'global', None) is None:
02692             category = 'global'
02693             self.actions._setObject(category, ActionCategory(id=category))
02694 
02695         if not 'reply' in object_.keys():
02696             object_._setObject('reply', reply)
02697         user = self.actions.user
02698         if not 'logged_in' in user.keys():
02699             user._setObject('logged_in', logged_in)
02700         if not 'change_ownership' in object_tabs.keys():
02701             object_tabs._setObject('change_ownership', change_ownership)
02702         del object_tabs
02703 
02704         cleanupOldActions(self.portal, out)
02705 
02706         self.failIf('reply' in object_.keys())
02707         self.failIf('logged_in' in user.keys())
02708         self.failIf('object_tabs' in self.actions.keys())
02709         self.failIf('global' in self.actions.keys())

Here is the call graph for this function:

Definition at line 2710 of file testMigrations.py.

02710 
02711     def testCleanupOldActionsTwice(self):
02712         out = []
02713         reply = Action('reply', title='Reply')
02714         logged_in = Action('logged_in', title='Logged in')
02715         change_ownership = Action('change_ownership', title='Change ownership')
02716 
02717         object_ = self.actions.object
02718         object_tabs = getattr(self.actions, 'object_tabs', None)
02719         if object_tabs is None:
02720             category = 'object_tabs'
02721             self.actions._setObject(category, ActionCategory(id=category))
02722             object_tabs = self.actions.object_tabs
02723         if getattr(self.actions, 'global', None) is None:
02724             category = 'global'
02725             self.actions._setObject(category, ActionCategory(id=category))
02726 
02727         if not 'reply' in object_.keys():
02728             object_._setObject('reply', reply)
02729         user = self.actions.user
02730         if not 'logged_in' in user.keys():
02731             user._setObject('logged_in', logged_in)
02732         if not 'change_ownership' in object_tabs.keys():
02733             object_tabs._setObject('change_ownership', change_ownership)
02734         del object_tabs
02735 
02736         cleanupOldActions(self.portal, out)
02737         cleanupOldActions(self.portal, out)
02738 
02739         self.failIf('reply' in object_.keys())
02740         self.failIf('logged_in' in user.keys())
02741         self.failIf('object_tabs' in self.actions.keys())
02742         self.failIf('global' in self.actions.keys())

Here is the call graph for this function:

Definition at line 2291 of file testMigrations.py.

02291 
02292     def testContentRulesConfiglet(self):
02293         pc = self.portal.portal_controlpanel
02294         self.removeActionIconFromTool('ContentRules')
02295         self.removeActionFromTool('ContentRules', action_provider='portal_controlpanel')
02296         addIconForContentRulesConfiglet(self.portal, [])
02297         addContentRulesConfiglet(self.portal, [])
02298         self.failUnless('ContentRules' in [x.getActionId() for x in self.icons.listActionIcons()])
02299         self.failUnless('ContentRules' in [x.getId() for x in pc.listActions()])
02300 

Here is the call graph for this function:

Definition at line 1893 of file testMigrations.py.

01893 
01894     def testDontRegisterToolsAsUtilities(self):
01895         sm = getSiteManager(self.portal)
01896         interfaces = (ILanguageTool, IArchivistTool, IPortalModifierTool,
01897                       IPurgePolicyTool, IRepositoryTool, IStorageTool,
01898                       IFormControllerTool, IReferenceCatalog, IUIDCatalog,
01899                       ICalendarTool, IActionsTool, ICatalogTool,
01900                       IContentTypeRegistry, ISkinsTool, ITypesTool, IURLTool,
01901                       IConfigurableWorkflowTool, IPloneTool, ICSSRegistry,
01902                       IJSRegistry, IUniqueIdHandler, IFactoryTool,
01903                       IMembershipTool, IGroupTool, IGroupDataTool,
01904                       IMemberDataTool, IArchetypeTool, ICachingPolicyManager,
01905                       IRegistrationTool, ITranslationServiceTool,
01906                       IControlPanel, ISetupTool, IQuickInstallerTool,
01907                      )
01908         for i in interfaces:
01909             sm.unregisterUtility(provided=i)
01910         registerToolsAsUtilities(self.portal, [])
01911         for i in interfaces:
01912             self.failUnless(sm.queryUtility(i) is None)
01913 
01914         for i in interfaces:
01915             sm.unregisterUtility(provided=i)
01916         registerToolsAsUtilities(self.portal, [])
01917         registerToolsAsUtilities(self.portal, [])
01918         for i in interfaces:
01919             self.failUnless(sm.queryUtility(i) is None)
    

Here is the call graph for this function:

Definition at line 1350 of file testMigrations.py.

01350 
01351     def testEnableZope3Site(self):
01352         # First we remove the site and site manager
01353         self.disableSite(self.portal)
01354         clearSite(self.portal)
01355         self.portal.setSiteManager(None)
01356 
01357         # Then run the migration step
01358         enableZope3Site(self.portal, [])
01359 
01360         # And see if we have an ISite with a local site manager
01361         self.failUnless(ISite.providedBy(self.portal))
01362         gsm = getGlobalSiteManager()
01363         sm = getSiteManager(self.portal)
01364         self.failIf(gsm is sm)
01365         lc = sm.utilities.LookupClass
01366         self.failUnless(lc == FiveVerifyingAdapterLookup)
01367 
01368         # Test the lookupclass migration
01369         sm.utilities.LookupClass = None
01370 
01371         enableZope3Site(self.portal, [])
01372 
01373         self.failUnless(sm.utilities.LookupClass == FiveVerifyingAdapterLookup)
01374         self.failUnless(sm.utilities.__parent__ == sm)
01375         self.failUnless(sm.__parent__ == self.portal)

Here is the call graph for this function:

Definition at line 1376 of file testMigrations.py.

01376 
01377     def testEnableZope3SiteTwice(self):
01378         # First we remove the site and site manager
01379         self.disableSite(self.portal)
01380         clearSite(self.portal)
01381         self.portal.setSiteManager(None)
01382 
01383         # Then run the migration step
01384         enableZope3Site(self.portal, [])
01385         enableZope3Site(self.portal, [])
01386 
01387         # And see if we have an ISite with a local site manager
01388         self.failUnless(ISite.providedBy(self.portal))
01389         gsm = getGlobalSiteManager()
01390         sm = getSiteManager(self.portal)
01391         self.failIf(gsm is sm)
01392 
01393         # Test the lookupclass migration
01394         sm.utilities.LookupClass = None
01395 
01396         enableZope3Site(self.portal, [])
01397         enableZope3Site(self.portal, [])
01398 
01399         self.failUnless(sm.utilities.LookupClass == FiveVerifyingAdapterLookup)
01400         self.failUnless(sm.utilities.__parent__ == sm)
01401         self.failUnless(sm.__parent__ == self.portal)

Here is the call graph for this function:

Definition at line 2284 of file testMigrations.py.

02284 
02285     def testInstallContentrulesUtility(self):
02286         sm = getSiteManager(self.portal)
02287         sm.unregisterUtility(provided=IRuleStorage)
02288         installContentRulesUtility(self.portal, [])
02289         installContentRulesUtility(self.portal, [])
02290         self.failIf(sm.queryUtility(IRuleStorage) is None)

Here is the call graph for this function:

Definition at line 2608 of file testMigrations.py.

02608 
02609     def testInstallI18NUtilities(self):
02610         sm = getSiteManager()
02611         sm.unregisterUtility(provided=ICountries)
02612         sm.unregisterUtility(provided=IContentLanguages)
02613         sm.unregisterUtility(provided=IMetadataLanguages)
02614         installI18NUtilities(self.portal, [])
02615         self.failIf(sm.queryUtility(ICountries) is None)
02616         self.failIf(sm.queryUtility(IContentLanguages) is None)
02617         self.failIf(sm.queryUtility(IMetadataLanguages) is None)

Here is the call graph for this function:

Definition at line 2618 of file testMigrations.py.

02618 
02619     def testInstallI18NUtilitiesTwice(self):
02620         sm = getSiteManager()
02621         sm.unregisterUtility(provided=ICountries)
02622         sm.unregisterUtility(provided=IContentLanguages)
02623         sm.unregisterUtility(provided=IMetadataLanguages)
02624         installI18NUtilities(self.portal, [])
02625         installI18NUtilities(self.portal, [])
02626         self.failIf(sm.queryUtility(ICountries) is None)
02627         self.failIf(sm.queryUtility(IContentLanguages) is None)
02628         self.failIf(sm.queryUtility(IMetadataLanguages) is None)

Here is the call graph for this function:

Definition at line 1920 of file testMigrations.py.

01920 
01921     def testInstallKss(self, unregister=True):
01922         'Test kss migration'
01923         jstool = self.portal.portal_javascripts
01924         csstool = self.portal.portal_css
01925         mt = self.portal.mimetypes_registry
01926         mtid = 'text/kss'
01927         st = self.portal.portal_skins
01928         skins = ['Plone Default']
01929         if unregister:
01930             # unregister first
01931             for id, _compression, _enabled in installKss.js_all:
01932                 jstool.unregisterResource(id)
01933             for id in installKss.css_all + installKss.kss_all:
01934                 csstool.unregisterResource(id)
01935             mt.manage_delObjects((mtid, ))
01936             js_ids = jstool.getResourceIds()
01937             for id, _compression, _enabled in installKss.js_all:
01938                 self.failIf(id in js_ids)
01939             css_ids = csstool.getResourceIds()
01940             for id in installKss.css_all + installKss.kss_all:
01941                 self.failIf(id in css_ids)
01942             self.failIf(mtid in mt.list_mimetypes())
01943             selections = st._getSelections()
01944             for s in skins:
01945                 if not selections.has_key(s):
01946                     continue
01947                 path = st.getSkinPath(s)
01948                 path = [p.strip() for p in  path.split(',')]
01949                 path_changed = False
01950                 if 'plone.kss' in path:
01951                     path.remove('plone.kss')
01952                     path_changed = True
01953                 if 'at.kss' in path:
01954                     path.remove('at.kss')
01955                     path_changed = True
01956                 if path_changed:
01957                     st.addSkinSelection(s, ','.join(path))
01958             # XXX we cannot remove the directory views, so...
01959         # migrate and test again
01960         installKss(self.portal, [])
01961         js_ids = jstool.getResourceIds()
01962         css_dict = csstool.getResourcesDict()
01963         for id in installKss.js_unregister:
01964             self.failIf(id in js_ids)
01965         for id, _compression, _enabled in installKss.js_all:
01966             self.assert_(id in js_ids, '%r is not registered' % id)
01967         for id in installKss.css_all:
01968             self.assert_(id in css_dict)
01969         for id in installKss.kss_all:
01970             self.assert_(id in css_dict)
01971             value = css_dict[id]
01972             self.assertEqual(value.getEnabled(), True)
01973             self.assertEqual(value.getRel(), 'k-stylesheet')
01974             self.assertEqual(value.getRendering(), 'link')
01975         self.assert_(mtid in mt.list_mimetypes())
01976         # check the skins
01977         selections = st._getSelections()
01978         for s in skins:
01979             if not selections.has_key(s):
01980                continue
01981             path = st.getSkinPath(s)
01982             path = [p.strip() for p in  path.split(',')]
01983             self.assert_('plone_kss' in path)
01984             self.assert_('archetypes_kss' in path)
01985         self.assert_(hasattr(aq_base(st), 'plone_kss'))
01986         self.assert_(hasattr(aq_base(st), 'archetypes_kss'))

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1987 of file testMigrations.py.

01987 
01988     def testInstallKssTwice(self):
01989         'Test kss migration, twice'
01990         self.testInstallKss()
01991         self.testInstallKss(unregister=False)
        

Here is the call graph for this function:

Definition at line 3134 of file testMigrations.py.

03134 
03135     def testInstallNewModifiers(self):
03136         # ensure the new modifiers are installed
03137         modifiers = self.portal.portal_modifier
03138         self.failUnless('AbortVersioningOfLargeFilesAndImages' in
03139                                                           modifiers.objectIds())
03140         modifiers.manage_delObjects(['AbortVersioningOfLargeFilesAndImages',
03141                                      'SkipVersioningOfLargeFilesAndImages'])
03142         self.failIf('AbortVersioningOfLargeFilesAndImages' in
03143                                                           modifiers.objectIds())
03144         installNewModifiers(self.portal, [])
03145         self.failUnless('AbortVersioningOfLargeFilesAndImages' in
03146                                                           modifiers.objectIds())
03147         self.failUnless('SkipVersioningOfLargeFilesAndImages' in
03148                                                           modifiers.objectIds())

Here is the call graph for this function:

Definition at line 3155 of file testMigrations.py.

03155 
03156     def testInstallNewModifiersDoesNotStompChanges(self):
03157         # ensure that reinstalling doesn't kill customizations
03158         modifiers = self.portal.portal_modifier
03159         modifiers.AbortVersioningOfLargeFilesAndImages.max_size = 1000
03160         installNewModifiers(self.portal, [])
03161         self.assertEqual(modifiers.AbortVersioningOfLargeFilesAndImages.max_size,
03162                          1000)

Here is the call graph for this function:

Definition at line 3163 of file testMigrations.py.

03163 
03164     def testInstallNewModifiersNoTool(self):
03165         # make sure there are no errors if the tool is missing
03166         self.portal._delObject('portal_modifier')
03167         installNewModifiers(self.portal, [])

Here is the call graph for this function:

Definition at line 3149 of file testMigrations.py.

03149 
03150     def testInstallNewModifiersTwice(self):
03151         # ensure that we get no errors when run twice
03152         modifiers = self.portal.portal_modifier
03153         installNewModifiers(self.portal, [])
03154         installNewModifiers(self.portal, [])

Here is the call graph for this function:

Definition at line 2629 of file testMigrations.py.

02629 
02630     def testInstallPloneLanguageTool(self):
02631         CMFSite.manage_delObjects(self.portal, ['portal_languages'])
02632         self.uninstallProduct('PloneLanguageTool')
02633         qi = getToolByName(self.portal, "portal_quickinstaller")
02634         installProduct('PloneLanguageTool', self.portal, [])
02635         self.failUnless(qi.isProductInstalled('PloneLanguageTool'))
02636         self.failUnless('portal_languages' in self.portal.keys())

Here is the call graph for this function:

Definition at line 1992 of file testMigrations.py.

01992 
01993     def testInstallRedirectorUtility(self):
01994         sm = getSiteManager(self.portal)
01995         sm.unregisterUtility(provided=IRedirectionStorage)
01996         installRedirectorUtility(self.portal, [])
01997         self.failIf(sm.queryUtility(IRedirectionStorage) is None)

Here is the call graph for this function:

Definition at line 1998 of file testMigrations.py.

01998 
01999     def testInstallRedirectorUtilityTwice(self):
02000         sm = getSiteManager(self.portal)
02001         sm.unregisterUtility(provided=IRedirectionStorage)
02002         installRedirectorUtility(self.portal, [])
02003         installRedirectorUtility(self.portal, [])
02004         self.failIf(sm.queryUtility(IRedirectionStorage) is None)
        

Here is the call graph for this function:

Definition at line 1611 of file testMigrations.py.

01611 
01612     def testLegacyPortletsConverted(self):
01613         self.setRoles(('Manager',))
01614         leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=self.portal)
01615         rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=self.portal)
01616         
01617         left = getMultiAdapter((self.portal, leftColumn,), IPortletAssignmentMapping, context=self.portal)
01618         right = getMultiAdapter((self.portal, rightColumn,), IPortletAssignmentMapping, context=self.portal)
01619         
01620         for k in left:
01621             del left[k]
01622         for k in right:
01623             del right[k]
01624                 
01625         self.portal.left_slots = ['here/portlet_recent/macros/portlet',
01626                                   'here/portlet_news/macros/portlet',
01627                                   'here/portlet_related/macros/portlet']
01628         self.portal.right_slots = ['here/portlet_login/macros/portlet',
01629                                    'here/portlet_languages/macros/portlet']
01630         
01631         convertLegacyPortlets(self.portal, [])
01632         
01633         self.assertEquals(self.portal.left_slots, [])
01634         self.assertEquals(self.portal.right_slots, [])
01635         
01636         lp = left.values()
01637         self.assertEquals(2, len(lp))
01638 
01639         self.failUnless(isinstance(lp[0], portlets.recent.Assignment))
01640         self.failUnless(isinstance(lp[1], portlets.news.Assignment))
01641         
01642         rp = right.values()
01643         self.assertEquals(1, len(rp))
01644         self.failUnless(isinstance(rp[0], portlets.login.Assignment))
01645         
01646         members = self.portal.Members
01647         portletAssignments = getMultiAdapter((members, rightColumn,), ILocalPortletAssignmentManager)
01648         self.assertEquals(True, portletAssignments.getBlacklistStatus(CONTEXT_PORTLETS))
        

Here is the call graph for this function:

Definition at line 1723 of file testMigrations.py.

01723 
01724     def testLegacyPortletsConvertedBadSlots(self):
01725         self.setRoles(('Manager',))
01726         leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=self.portal)
01727         rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=self.portal)
01728         
01729         left = getMultiAdapter((self.portal, leftColumn,), IPortletAssignmentMapping, context=self.portal)
01730         right = getMultiAdapter((self.portal, rightColumn,), IPortletAssignmentMapping, context=self.portal)
01731         
01732         for k in left:
01733             del left[k]
01734         for k in right:
01735             del right[k]
01736         
01737         self.portal.left_slots = ['here/portlet_recent/macros/portlet',
01738                                   'here/portlet_news/macros/portlet',
01739                                   'foobar',]
01740         self.portal.right_slots = ['here/portlet_login/macros/portlet']
01741         
01742         convertLegacyPortlets(self.portal, [])
01743         
01744         self.assertEquals(self.portal.left_slots, [])
01745         self.assertEquals(self.portal.right_slots, [])
01746         
01747         lp = left.values()
01748         self.assertEquals(2, len(lp))
01749 
01750         self.failUnless(isinstance(lp[0], portlets.recent.Assignment))
01751         self.failUnless(isinstance(lp[1], portlets.news.Assignment))
01752         
01753         rp = right.values()
01754         self.assertEquals(1, len(rp))
01755         self.failUnless(isinstance(rp[0], portlets.login.Assignment))
01756         
01757         members = self.portal.Members
01758         portletAssignments = getMultiAdapter((members, rightColumn,), ILocalPortletAssignmentManager)
01759         self.assertEquals(True, portletAssignments.getBlacklistStatus(CONTEXT_PORTLETS))
        

Here is the call graph for this function:

Definition at line 1760 of file testMigrations.py.

01760 
01761     def testLegacyPortletsConvertedNoMembersFolder(self):
01762         self.setRoles(('Manager',))
01763         leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=self.portal)
01764         rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=self.portal)
01765         
01766         left = getMultiAdapter((self.portal, leftColumn,), IPortletAssignmentMapping, context=self.portal)
01767         right = getMultiAdapter((self.portal, rightColumn,), IPortletAssignmentMapping, context=self.portal)
01768         
01769         for k in left:
01770             del left[k]
01771         for k in right:
01772             del right[k]
01773         
01774         self.portal.left_slots = ['here/portlet_recent/macros/portlet',
01775                                   'here/portlet_news/macros/portlet',
01776                                   'foobar',]
01777         self.portal.right_slots = ['here/portlet_login/macros/portlet']
01778         
01779         
01780         self.portal._delObject('Members')
01781         
01782         convertLegacyPortlets(self.portal, [])
01783         
01784         self.assertEquals(self.portal.left_slots, [])
01785         self.assertEquals(self.portal.right_slots, [])
01786         
01787         lp = left.values()
01788         self.assertEquals(2, len(lp))
01789         
01790         self.failUnless(isinstance(lp[0], portlets.recent.Assignment))
01791         self.failUnless(isinstance(lp[1], portlets.news.Assignment))
01792         
01793         rp = right.values()
01794         self.assertEquals(1, len(rp))
01795         self.failUnless(isinstance(rp[0], portlets.login.Assignment))

Here is the call graph for this function:

Definition at line 1688 of file testMigrations.py.

01688 
01689     def testLegacyPortletsConvertedNoSlots(self):
01690         self.setRoles(('Manager',))
01691         leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=self.portal)
01692         rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=self.portal)
01693         
01694         left = getMultiAdapter((self.portal, leftColumn,), IPortletAssignmentMapping, context=self.portal)
01695         right = getMultiAdapter((self.portal, rightColumn,), IPortletAssignmentMapping, context=self.portal)
01696         
01697         for k in left:
01698             del left[k]
01699         for k in right:
01700             del right[k]
01701             
01702         self.portal.left_slots = ['here/portlet_recent/macros/portlet',
01703                                   'here/portlet_news/macros/portlet']
01704         if hasattr(self.portal.aq_base, 'right_slots'):
01705             delattr(self.portal, 'right_slots')
01706         
01707         convertLegacyPortlets(self.portal, [])
01708         
01709         self.assertEquals(self.portal.left_slots, [])
01710         
01711         lp = left.values()
01712         self.assertEquals(2, len(lp))
01713         
01714         self.failUnless(isinstance(lp[0], portlets.recent.Assignment))
01715         self.failUnless(isinstance(lp[1], portlets.news.Assignment))
01716         
01717         rp = right.values()
01718         self.assertEquals(0, len(rp))
01719         
01720         members = self.portal.Members
01721         portletAssignments = getMultiAdapter((members, rightColumn,), ILocalPortletAssignmentManager)
01722         self.assertEquals(True, portletAssignments.getBlacklistStatus(CONTEXT_PORTLETS))
        

Here is the call graph for this function:

Definition at line 1649 of file testMigrations.py.

01649 
01650     def testLegacyPortletsConvertedTwice(self):
01651         self.setRoles(('Manager',))
01652         leftColumn = getUtility(IPortletManager, name=u'plone.leftcolumn', context=self.portal)
01653         rightColumn = getUtility(IPortletManager, name=u'plone.rightcolumn', context=self.portal)
01654         
01655         left = getMultiAdapter((self.portal, leftColumn,), IPortletAssignmentMapping, context=self.portal)
01656         right = getMultiAdapter((self.portal, rightColumn,), IPortletAssignmentMapping, context=self.portal)
01657         
01658         for k in left:
01659             del left[k]
01660         for k in right:
01661             del right[k]
01662             
01663         self.portal.left_slots = ['here/portlet_recent/macros/portlet',
01664                                   'here/portlet_news/macros/portlet',
01665                                   'here/portlet_related/macros/portlet']
01666         self.portal.right_slots = ['here/portlet_login/macros/portlet',
01667                                    'here/portlet_languages/macros/portlet']
01668         
01669         convertLegacyPortlets(self.portal, [])
01670         convertLegacyPortlets(self.portal, [])
01671         
01672         self.assertEquals(self.portal.left_slots, [])
01673         self.assertEquals(self.portal.right_slots, [])
01674         
01675         lp = left.values()
01676         self.assertEquals(2, len(lp))
01677         
01678         self.failUnless(isinstance(lp[0], portlets.recent.Assignment))
01679         self.failUnless(isinstance(lp[1], portlets.news.Assignment))
01680         
01681         rp = right.values()
01682         self.assertEquals(1, len(rp))
01683         self.failUnless(isinstance(rp[0], portlets.login.Assignment))
01684         
01685         members = self.portal.Members
01686         portletAssignments = getMultiAdapter((members, rightColumn,), ILocalPortletAssignmentManager)
01687         self.assertEquals(True, portletAssignments.getBlacklistStatus(CONTEXT_PORTLETS))
        

Here is the call graph for this function:

Definition at line 2056 of file testMigrations.py.

02056 
02057     def testMigrateLocalroleForm(self):
02058         fti = self.portal.portal_types['Document']
02059         aliases = fti.getMethodAliases()
02060         aliases['sharing'] = 'folder_localrole_form'
02061         fti.setMethodAliases(aliases)
02062         fti.addAction('test', 'Test', 'string:${object_url}/folder_localrole_form', None, 'View', 'object')
02063         migrateLocalroleForm(self.portal, [])
02064         self.assertEquals('@@sharing', fti.getMethodAliases()['sharing'])
02065         test_action = fti.listActions()[-1]
02066         self.assertEquals('string:${object_url}/@@sharing', test_action.getActionExpression())

Here is the call graph for this function:

Definition at line 2079 of file testMigrations.py.

02079 
02080     def testMigrateLocalroleFormNoTool(self):
02081         self.portal._delObject('portal_types')
02082         migrateLocalroleForm(self.portal, [])

Here is the call graph for this function:

Definition at line 2067 of file testMigrations.py.

02067 
02068     def testMigrateLocalroleFormTwice(self):
02069         fti = self.portal.portal_types['Document']
02070         aliases = fti.getMethodAliases()
02071         aliases['sharing'] = 'folder_localrole_form'
02072         fti.setMethodAliases(aliases)
02073         fti.addAction('test', 'Test', 'string:${object_url}/folder_localrole_form', None, 'View', 'object')
02074         migrateLocalroleForm(self.portal, [])
02075         migrateLocalroleForm(self.portal, [])
02076         self.assertEquals('@@sharing', fti.getMethodAliases()['sharing'])
02077         test_action = fti.listActions()[-1]
02078         self.assertEquals('string:${object_url}/@@sharing', test_action.getActionExpression())
        

Here is the call graph for this function:

Definition at line 2600 of file testMigrations.py.

02600 
02601     def testMigratePloneTool(self):
02602         from Products.CMFPlone import ToolNames
02603         tool = self.portal.plone_utils
02604         tool.meta_type = 'PlonePAS Utilities Tool'
02605         restorePloneTool(self.portal, [])
02606         tool = self.portal.plone_utils
02607         self.assertEquals(ToolNames.UtilsTool, tool.meta_type)

Here is the call graph for this function:

Definition at line 3027 of file testMigrations.py.

03027 
03028     def testMoveKupuAndCMFPWControlPanel(self):
03029         kupu = self.cp.getActionObject('Plone/kupu')
03030         kupu.category = 'Products'
03031         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03032         if cmfpw is None:
03033             self.cp.registerConfiglet(**placeful_prefs_configlet)
03034         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03035         cmfpw.category = 'Plone'
03036         # migrate
03037         moveKupuAndCMFPWControlPanel(self.portal, [])
03038         kupu = self.cp.getActionObject('Plone/kupu')
03039         self.assertEquals(kupu.getCategory(), 'Plone')
03040         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03041         self.assertEquals(cmfpw.getCategory(), 'Products')

Here is the call graph for this function:

Definition at line 3059 of file testMigrations.py.

03059 
03060     def testMoveKupuAndCMFPWControlPanelNoTool(self):
03061         # Should not fail if tool is missing
03062         self.portal._delObject('portal_controlpanel')
03063         moveKupuAndCMFPWControlPanel(self.portal, [])

Here is the call graph for this function:

Definition at line 3042 of file testMigrations.py.

03042 
03043     def testMoveKupuAndCMFPWControlPanelTwice(self):
03044         # Should not fail if done twice
03045         kupu = self.cp.getActionObject('Plone/kupu')
03046         kupu.category = 'Products'
03047         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03048         if cmfpw is None:
03049             self.cp.registerConfiglet(**placeful_prefs_configlet)
03050         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03051         cmfpw.category = 'Plone'
03052         # migrate
03053         moveKupuAndCMFPWControlPanel(self.portal, [])
03054         moveKupuAndCMFPWControlPanel(self.portal, [])
03055         kupu = self.cp.getActionObject('Plone/kupu')
03056         self.assertEquals(kupu.getCategory(), 'Plone')
03057         cmfpw = self.cp.getActionObject('Products/placefulworkflow')
03058         self.assertEquals(cmfpw.getCategory(), 'Products')

Here is the call graph for this function:

Definition at line 2558 of file testMigrations.py.

02558 
02559     def testObjectProvidesIndex(self):
02560         catalog = getToolByName(self.portal, 'portal_catalog')
02561         if 'object_provides' in catalog.indexes():
02562             catalog.delIndex('object_provides')
02563         self.failIf('object_provides' in catalog.indexes())
02564         addObjectProvidesIndex(self.portal, [])
02565         self.failUnless('object_provides' in catalog.indexes())

Here is the call graph for this function:

Definition at line 2269 of file testMigrations.py.

02269 
02270     def testPASPluginInterfaces(self):
02271         pas = self.portal.acl_users
02272         from Products.PluggableAuthService.interfaces.plugins import IUserEnumerationPlugin
02273         pas.plugins.deactivatePlugin(IUserEnumerationPlugin, 'mutable_properties')
02274         updatePASPlugins(self.portal, [])
02275 
02276         plugin = pas.mutable_properties
02277         for intf_id in plugin.listInterfaces():
02278             try:
02279                 intf = pas.plugins._getInterfaceFromName(intf_id)
02280                 self.failUnless('mutable_properties' in pas.plugins.listPluginIds(intf))
02281             except KeyError:
02282                 # Ignore unregistered interface types 
02283                 pass

Here is the call graph for this function:

Definition at line 2241 of file testMigrations.py.

02241 
02242     def testPloneS5(self):
02243         pa = self.portal.portal_actions
02244         self.removeActionIconFromTool('s5_presentation')
02245         self.removeActionFromTool('s5_presentation', action_provider='portal_actions')
02246         installS5(self.portal, [])
02247         
02248         self.folder.invokeFactory('Document', id="test_document")
02249         doc_ids = self.portal.portal_actions.listFilteredActionsFor(self.folder.test_document)["document_actions"]
02250         assert "s5_presentation" not in [ i["id"] for i in doc_ids ]
02251         
02252         self.folder.invokeFactory('News Item', id="test_news_item")
02253         ni_ids = self.portal.portal_actions.listFilteredActionsFor(self.folder.test_news_item)["document_actions"]
02254         assert "s5_presentation" not in [ i["id"] for i in ni_ids ]
02255         
02256         # add in something to the document
02257         self.folder.test_document.setPresentation(True)
02258         self.folder.test_document.setText("<h1>Test</h1><p>foo</p>")
02259         
02260         # now it should appear
02261         doc_ids = self.portal.portal_actions.listFilteredActionsFor(self.folder.test_document)["document_actions"]
02262         assert "s5_presentation" in [ i["id"] for i in doc_ids ]
02263         
02264         # and install again
02265         self.failUnless('s5_presentation' in [x.getActionId() for x in self.icons.listActionIcons()])
02266         installS5(self.portal, [])
02267         self.failUnless('s5_presentation' in [x.getActionId() for x in self.icons.listActionIcons()])
02268 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2773 of file testMigrations.py.

02773 
02774     def testPloneS5(self):
02775         pt = getToolByName(self.portal, "portal_types")
02776         ait = getToolByName(self.portal, "portal_actionicons")
02777         document = pt.restrictedTraverse('Document')
02778 
02779         action_ids = [x.getId() for x in document.listActions()]
02780         assert "s5_presentation" not in action_ids
02781 
02782         icon_ids = [x.getActionId() for x in ait.listActionIcons()]
02783         assert "s5_presentation" not in icon_ids
02784 
02785         installS5(self.portal, [])
02786 
02787         action_ids = [x.getId() for x in document.listActions()]
02788         assert "s5_presentation" in action_ids
02789 
02790         icon_ids = [x.getActionId() for x in ait.listActionIcons()]
02791         assert "s5_presentation" in icon_ids
02792 
02793         removeS5Actions(self.portal, [])
02794 
02795         action_ids = [x.getId() for x in document.listActions()]
02796         assert "s5_presentation" not in action_ids
02797 
02798         icon_ids = [x.getActionId() for x in ait.listActionIcons()]
02799         assert "s5_presentation" not in icon_ids

Here is the call graph for this function:

Definition at line 1872 of file testMigrations.py.

01872 
01873     def testRegisterToolsAsUtilities(self):
01874         sm = getSiteManager(self.portal)
01875         interfaces = (ISiteRoot, IPloneSiteRoot, IInterfaceTool,
01876                       IMigrationTool, IActionIconsTool, ISyndicationTool,
01877                       IMetadataTool, IPropertiesTool, IUndoTool, IMailHost,
01878                       IUniqueIdAnnotationManagement, IUniqueIdGenerator,
01879                       IDiffTool, IATCTTool, IMimetypesRegistryTool,
01880                       IPortalTransformsTool, IDiscussionTool, )
01881         for i in interfaces:
01882             sm.unregisterUtility(provided=i)
01883         registerToolsAsUtilities(self.portal, [])
01884         for i in interfaces:
01885             self.failIf(sm.queryUtility(i) is None)
01886 
01887         for i in interfaces:
01888             sm.unregisterUtility(provided=i)
01889         registerToolsAsUtilities(self.portal, [])
01890         registerToolsAsUtilities(self.portal, [])
01891         for i in interfaces:
01892             self.failIf(sm.queryUtility(i) is None)

Here is the call graph for this function:

Definition at line 2899 of file testMigrations.py.

02899 
02900     def testRemoveSharingAction(self):
02901         fti = self.types['Document']
02902         fti.addAction(id='local_roles', name='Sharing', 
02903                       action='string:${object_url}/sharing',
02904                       condition=None, permission='Manage properties',
02905                       category='object')
02906         removeSharingAction(self.portal, [])
02907         self.failIf('local_roles' in [a.id for a in fti.listActions()])
        

Here is the call graph for this function:

Definition at line 2908 of file testMigrations.py.

02908 
02909     def testRemoveSharingActionNoTool(self):
02910         self.portal._delOb('portal_types')
02911         removeSharingAction(self.portal, [])
        

Here is the call graph for this function:

Definition at line 2912 of file testMigrations.py.

02912 
02913     def testRemoveSharingActionTwice(self):
02914         fti = self.types['Document']
02915         fti.addAction(id='local_roles', name='Sharing', 
02916                       action='string:${object_url}/sharing',
02917                       condition=None, permission='Manage properties',
02918                       category='object')
02919         removeSharingAction(self.portal, [])
02920         removeSharingAction(self.portal, [])
02921         self.failIf('local_roles' in [a.id for a in fti.listActions()])
        

Here is the call graph for this function:

Definition at line 2083 of file testMigrations.py.

02083 
02084     def testReorderUserActions(self):
02085         self.actions.user.moveObjectsToTop(['logout', 'undo', 'join'])
02086         reorderUserActions(self.portal, [])
02087         # build a dict that has the position as the value to make it easier to
02088         # compare postions in the ordered list of actions
02089         n = 0
02090         sort = {}
02091         for action in self.actions.user.objectIds():
02092             sort[action] = n
02093             n += 1
02094         self.failUnless(sort['preferences'] < sort['undo'])
02095         self.failUnless(sort['undo'] < sort['logout'])
02096         self.failUnless(sort['login'] < sort['join'])

Here is the call graph for this function:

Definition at line 2116 of file testMigrations.py.

02116 
02117     def testReorderUserActionsIncompleteActions(self):
02118         self.actions.user.moveObjectsToTop(['logout', 'undo', 'join'])
02119         self.actions.user._delObject('preferences')
02120         reorderUserActions(self.portal, [])
02121         # build a dict that has the position as the value to make it easier to
02122         # compare postions in the ordered list of actions
02123         n = 0
02124         sort = {}
02125         for action in self.actions.user.objectIds():
02126             sort[action] = n
02127             n += 1
02128         self.failUnless(sort['undo'] < sort['logout'])
02129         self.failUnless(sort['login'] < sort['join'])

Here is the call graph for this function:

Definition at line 2112 of file testMigrations.py.

02112 
02113     def testReorderUserActionsNoTool(self):
02114         self.portal._delObject('portal_actions')
02115         reorderUserActions(self.portal, [])

Here is the call graph for this function:

Definition at line 2097 of file testMigrations.py.

02097 
02098     def testReorderUserActionsTwice(self):
02099         self.actions.user.moveObjectsToTop(['logout', 'undo', 'join'])
02100         reorderUserActions(self.portal, [])
02101         reorderUserActions(self.portal, [])
02102         # build a dict that has the position as the value to make it easier to
02103         # compare postions in the ordered list of actions
02104         n = 0
02105         sort = {}
02106         for action in self.actions.user.objectIds():
02107             sort[action] = n
02108             n += 1
02109         self.failUnless(sort['preferences'] < sort['undo'])
02110         self.failUnless(sort['undo'] < sort['logout'])
02111         self.failUnless(sort['login'] < sort['join'])

Here is the call graph for this function:

Definition at line 2477 of file testMigrations.py.

02477 
02478     def testTablelessRemoval(self):
02479         st = getToolByName(self.portal, "portal_skins")
02480         if "Plone Tableless" not in st.getSkinSelections():
02481             st.addSkinSelection('Plone Tableless', 'one,two', make_default=True)
02482         removeTablelessSkin(self.portal, [])
02483         self.failIf('Plone Tableless' in st.getSkinSelections())
02484         self.failIf(st.default_skin == 'Plone Tableless')

Here is the call graph for this function:

Definition at line 2334 of file testMigrations.py.

02334 
02335     def testUpdateConfigletTitles(self):
02336         collection = self.cp.getActionObject('Plone/portal_atct')
02337         language = self.cp.getActionObject('Plone/PloneLanguageTool')
02338         navigation = self.cp.getActionObject('Plone/NavigationSettings')
02339         types = self.cp.getActionObject('Plone/TypesSettings')
02340         users = self.cp.getActionObject('Plone/UsersGroups')
02341         users2 = self.cp.getActionObject('Plone/UsersGroups2')
02342         updateConfigletTitles(self.portal, [])
02343         self.assertEquals(collection.title, 'Collection')
02344         self.assertEquals(language.title, 'Language')
02345         self.assertEquals(navigation.title, 'Navigation')
02346         self.assertEquals(types.title, 'Types')
02347         self.assertEquals(users.title, 'Users and Groups')
02348         self.assertEquals(users2.title, 'Users and Groups')

Here is the call graph for this function:

Definition at line 2365 of file testMigrations.py.

02365 
02366     def testUpdateConfigletTitlesNoTool(self):
02367         # Should not fail if tool is missing
02368         self.portal._delObject('portal_controlpanel')
02369         updateConfigletTitles(self.portal, [])

Here is the call graph for this function:

Definition at line 2349 of file testMigrations.py.

02349 
02350     def testUpdateConfigletTitlesTwice(self):
02351         collection = self.cp.getActionObject('Plone/portal_atct')
02352         language = self.cp.getActionObject('Plone/PloneLanguageTool')
02353         navigation = self.cp.getActionObject('Plone/NavigationSettings')
02354         types = self.cp.getActionObject('Plone/TypesSettings')
02355         users = self.cp.getActionObject('Plone/UsersGroups')
02356         users2 = self.cp.getActionObject('Plone/UsersGroups2')
02357         updateConfigletTitles(self.portal, [])
02358         updateConfigletTitles(self.portal, [])
02359         self.assertEquals(collection.title, 'Collection')
02360         self.assertEquals(language.title, 'Language')
02361         self.assertEquals(navigation.title, 'Navigation')
02362         self.assertEquals(types.title, 'Types')
02363         self.assertEquals(users.title, 'Users and Groups')
02364         self.assertEquals(users2.title, 'Users and Groups')

Here is the call graph for this function:

Definition at line 2485 of file testMigrations.py.

02485 
02486     def testUpdateCssQueryJS(self):
02487         jsreg = self.portal.portal_javascripts
02488         jsreg.registerScript("folder_contents_hideAddItems.js")
02489         self.failUnless('folder_contents_hideAddItems.js' in jsreg.getResourceIds())
02490         # migrate and test again
02491         removeHideAddItemsJS(self.portal, [])
02492         self.failIf('folder_contents_hideAddItems.js' in jsreg.getResourceIds())
02493         # try double migration
02494         removeHideAddItemsJS(self.portal, [])

Here is the call graph for this function:

Definition at line 2946 of file testMigrations.py.

02946 
02947     def testUpdateEditActionConditionForLocking(self):
02948         out = []
02949         lockable_types = ['Document', 'Event', 'Favorite', 'File', 'Folder',
02950                           'Image', 'Large Plone Folder', 'Link',
02951                           'News Item', 'Topic']
02952         for contentType in lockable_types:
02953             fti = self.types.getTypeInfo(contentType)
02954             for action in fti.listActions():
02955                 if action.getId() == 'edit':
02956                     action.condition = ''
02957         updateEditActionConditionForLocking(self.portal, out)
02958         for contentType in lockable_types:
02959             fti = self.types.getTypeInfo(contentType)
02960             for action in fti.listActions():
02961                 if action.getId() == 'edit':
02962                     expressionCondition = action.condition
02963                     self.assertEquals(action.condition.text, "not:object/@@plone_lock_info/is_locked_for_current_user|python:True")

Here is the call graph for this function:

Definition at line 2964 of file testMigrations.py.

02964 
02965     def testUpdateEditActionConditionForLockingTwice(self):
02966         out = []
02967         lockable_types = ['Document', 'Event', 'Favorite', 'File', 'Folder',
02968                           'Image', 'Large Plone Folder', 'Link',
02969                           'News Item', 'Topic']
02970         for contentType in lockable_types:
02971             fti = self.types.getTypeInfo(contentType)
02972             for action in fti.listActions():
02973                 if action.getId() == 'edit':
02974                     action.condition = ''
02975         updateEditActionConditionForLocking(self.portal, out)
02976         updateEditActionConditionForLocking(self.portal, out)
02977         for contentType in lockable_types:
02978             fti = self.types.getTypeInfo(contentType)
02979             for action in fti.listActions():
02980                 if action.getId() == 'edit':
02981                     expressionCondition = action.condition
02982                     self.assertEquals(action.condition.text, "not:object/@@plone_lock_info/is_locked_for_current_user|python:True")

Here is the call graph for this function:

Definition at line 2983 of file testMigrations.py.

02983 
02984     def testUpdateEditExistingActionConditionForLocking(self):
02985         out = []
02986         fti = self.types.getTypeInfo('Document')
02987         for action in fti.listActions():
02988             if action.getId() == 'edit':
02989                 action.condition = Expression("foo")
02990         updateEditActionConditionForLocking(self.portal, out)
02991         fti = self.types.getTypeInfo('Document')
02992         for action in fti.listActions():
02993             if action.getId() == 'edit':
02994                 self.assertEquals(action.condition.text, 'foo')

Here is the call graph for this function:

Definition at line 1585 of file testMigrations.py.

01585 
01586     def testUpdateFTII18NDomain(self):
01587         doc = self.types.Document
01588         doc.i18n_domain = ''
01589         # Update FTI's
01590         updateFTII18NDomain(self.portal, [])
01591         # domain should have been updated
01592         self.assertEquals(doc.i18n_domain, 'plone')

Here is the call graph for this function:

Definition at line 1602 of file testMigrations.py.

01602 
01603     def testUpdateFTII18NDomainNonAscii(self):
01604         doc = self.types.Document
01605         doc.i18n_domain = ''
01606         doc.title = 'Foo\xc3'
01607         # Update FTI's
01608         updateFTII18NDomain(self.portal, [])
01609         # domain should have been updated
01610         self.assertEquals(doc.i18n_domain, '')

Here is the call graph for this function:

Definition at line 1593 of file testMigrations.py.

01593 
01594     def testUpdateFTII18NDomainTwice(self):
01595         doc = self.types.Document
01596         doc.i18n_domain = ''
01597         # Update FTI's twice
01598         updateFTII18NDomain(self.portal, [])
01599         updateFTII18NDomain(self.portal, [])
01600         # domain should have been updated
01601         self.assertEquals(doc.i18n_domain, 'plone')

Here is the call graph for this function:

Definition at line 2419 of file testMigrations.py.

02419 
02420     def testUpdateKukitJS(self):
02421         jsreg = self.portal.portal_javascripts
02422         # put into old state first
02423         jsreg.unregisterResource('++resource++kukit.js')
02424         jsreg.unregisterResource('++resource++kukit-devel.js')
02425         script_ids = jsreg.getResourceIds()
02426         self.failIf('++resource++kukit.js' in script_ids)
02427         self.failIf('++resource++kukit-devel.js' in script_ids)
02428         self.failIf('++resource++kukit-src.js' in script_ids)
02429         jsreg.registerScript('++resource++kukit.js', compression="none")
02430         script_ids = jsreg.getResourceIds()
02431         self.failUnless('++resource++kukit.js' in script_ids)
02432         # migrate and test again
02433         updateKukitJS(self.portal, [])
02434         script_ids = jsreg.getResourceIds()
02435         self.failUnless('++resource++kukit-src.js' in script_ids)
02436         resource = jsreg.getResource('++resource++kukit-src.js')
02437         self.failUnless(resource.getCompression() == 'full')
02438         # Run the last migration and check that everything is in its
02439         # place. We must have both the devel and production resources.
02440         # They both should be uncompressed since kss compresses them
02441         # directly. Also they should have conditions that switches them.
02442         beta3_rc1(self.portal)
02443         script_ids = jsreg.getResourceIds()
02444         self.failIf('++resource++kukit-src.js' in script_ids)
02445         resource1 = jsreg.getResource('++resource++kukit.js')
02446         resource2 = jsreg.getResource('++resource++kukit-devel.js')
02447         self.failUnless(resource1.getCompression() == 'none')
02448         self.failUnless(resource2.getCompression() == 'none')
02449         self.failUnless('@@kss_devel_mode' in resource1.getExpression())
02450         self.failUnless('@@kss_devel_mode' in resource2.getExpression())
02451         self.failUnless('isoff' in resource1.getExpression())
02452         self.failUnless('ison' in resource2.getExpression())
        

Here is the call graph for this function:

Definition at line 3064 of file testMigrations.py.

03064 
03065     def testUpdateLanguageControlPanel(self):
03066         lang = self.cp.getActionObject('Plone/PloneLanguageTool')
03067         lang.action = Expression('string:lang')
03068         updateLanguageControlPanel(self.portal, [])
03069         self.assertEquals(lang.action.text,
03070                           'string:${portal_url}/@@language-controlpanel')

Here is the call graph for this function:

Definition at line 3080 of file testMigrations.py.

03080 
03081     def testUpdateLanguageControlPanelNoTool(self):
03082         # Should not fail if tool is missing
03083         self.portal._delObject('portal_controlpanel')
03084         updateLanguageControlPanel(self.portal, [])

Here is the call graph for this function:

Definition at line 3071 of file testMigrations.py.

03071 
03072     def testUpdateLanguageControlPanelTwice(self):
03073         # Should not fail if done twice
03074         lang = self.cp.getActionObject('Plone/PloneLanguageTool')
03075         lang.action = Expression('string:lang')
03076         updateLanguageControlPanel(self.portal, [])
03077         updateLanguageControlPanel(self.portal, [])
03078         self.assertEquals(lang.action.text,
03079                           'string:${portal_url}/@@language-controlpanel')

Here is the call graph for this function:

Definition at line 2218 of file testMigrations.py.

02218 
02219     def testUpdateMemberSecurity(self):
02220         pprop = getToolByName(self.portal, 'portal_properties')
02221         self.assertEquals(
02222                 pprop.site_properties.getProperty('allowAnonymousViewAbout'),
02223                 False)
02224 
02225         pmembership = getToolByName(self.portal, 'portal_membership')
02226         self.assertEquals(pmembership.memberareaCreationFlag, False)
02227 
02228         self.assertEquals(self.portal.getProperty('validate_email'), True)
02229 
02230         app_roles = self.portal.rolesOfPermission(permission='Add portal member')
02231         app_perms = self.portal.permission_settings(permission='Add portal member')
02232         acquire_check = app_perms[0]['acquire']
02233         reg_roles = []
02234         for appperm in app_roles:
02235             if appperm['selected'] == 'SELECTED':
02236                 reg_roles.append(appperm['name'])
02237         self.failUnless('Manager' in reg_roles)
02238         self.failUnless('Owner' in reg_roles)
02239         self.failUnless(acquire_check == '')
02240 

Here is the call graph for this function:

Definition at line 2130 of file testMigrations.py.

02130 
02131     def testUpdateRtlCSSexpression(self):
02132         cssreg = self.portal.portal_css
02133         rtl = cssreg.getResource('RTL.css')
02134         rtl.setExpression('string:foo')
02135         updateRtlCSSexpression(self.portal, [])
02136         expr = rtl.getExpression()
02137         self.failUnless(expr == "python:portal.restrictedTraverse('@@plone_portal_state').is_rtl()")

Here is the call graph for this function:

Definition at line 2138 of file testMigrations.py.

02138 
02139     def testUpdateRtlCSSexpressionTwice(self):
02140         # perform migration twice
02141         cssreg = self.portal.portal_css
02142         rtl = cssreg.getResource('RTL.css')
02143         rtl.setExpression('string:foo')
02144         updateRtlCSSexpression(self.portal, [])
02145         updateRtlCSSexpression(self.portal, [])
02146         expr = rtl.getExpression()
02147         self.failUnless(expr == "python:portal.restrictedTraverse('@@plone_portal_state').is_rtl()")

Here is the call graph for this function:

Definition at line 1839 of file testMigrations.py.

01839 
01840     def testUpdateSearchAndMailHostConfiglet(self):
01841         search = self.cp.getActionObject('Plone/SearchSettings')
01842         mail = self.cp.getActionObject('Plone/MailHost')
01843         search.action = Expression('string:search')
01844         mail.action = Expression('string:mail')
01845         updateSearchAndMailHostConfiglet(self.portal, [])
01846         self.assertEquals(search.title, 'Search')
01847         self.assertEquals(search.action.text,
01848                           'string:${portal_url}/@@search-controlpanel')
01849         self.assertEquals(mail.title, 'Mail')
01850         self.assertEquals(mail.action.text,
01851                           'string:${portal_url}/@@mail-controlpanel')
    

Here is the call graph for this function:

Definition at line 1867 of file testMigrations.py.

01867 
01868     def testUpdateSearchAndMailHostConfigletNoTool(self):
01869         # Should not fail if tool is missing
01870         self.portal._delObject('portal_controlpanel')
01871         updateSearchAndMailHostConfiglet(self.portal, [])

Here is the call graph for this function:

Definition at line 1852 of file testMigrations.py.

01852 
01853     def testUpdateSearchAndMailHostConfigletTwice(self):
01854         # Should not fail if done twice
01855         search = self.cp.getActionObject('Plone/SearchSettings')
01856         mail = self.cp.getActionObject('Plone/MailHost')
01857         search.action = Expression('string:search')
01858         mail.action = Expression('string:mail')
01859         updateSearchAndMailHostConfiglet(self.portal, [])
01860         updateSearchAndMailHostConfiglet(self.portal, [])
01861         self.assertEquals(search.title, 'Search')
01862         self.assertEquals(search.action.text,
01863                           'string:${portal_url}/@@search-controlpanel')
01864         self.assertEquals(mail.title, 'Mail')
01865         self.assertEquals(mail.action.text,
01866                           'string:${portal_url}/@@mail-controlpanel')
    

Here is the call graph for this function:

Definition at line 2301 of file testMigrations.py.

02301 
02302     def testUpdateSkinsAndSiteConfiglet(self):
02303         skins = self.cp.getActionObject('Plone/PortalSkin')
02304         site = self.cp.getActionObject('Plone/PloneReconfig')
02305         skins.action = Expression('string:skins')
02306         site.action = Expression('string:site')
02307         updateSkinsAndSiteConfiglet(self.portal, [])
02308         self.assertEquals(skins.title, 'Themes')
02309         self.assertEquals(skins.action.text,
02310                           'string:${portal_url}/@@skins-controlpanel')
02311         self.assertEquals(site.title, 'Site settings')
02312         self.assertEquals(site.action.text,
02313                           'string:${portal_url}/@@site-controlpanel')
    

Here is the call graph for this function:

Definition at line 2329 of file testMigrations.py.

02329 
02330     def testUpdateSkinsAndSiteConfigletNoTool(self):
02331         # Should not fail if tool is missing
02332         self.portal._delObject('portal_controlpanel')
02333         updateSkinsAndSiteConfiglet(self.portal, [])

Here is the call graph for this function:

Definition at line 2314 of file testMigrations.py.

02314 
02315     def testUpdateSkinsAndSiteConfigletTwice(self):
02316         # Should not fail if done twice
02317         skins = self.cp.getActionObject('Plone/PortalSkin')
02318         site = self.cp.getActionObject('Plone/PloneReconfig')
02319         skins.action = Expression('string:skins')
02320         site.action = Expression('string:site')
02321         updateSkinsAndSiteConfiglet(self.portal, [])
02322         updateSkinsAndSiteConfiglet(self.portal, [])
02323         self.assertEquals(skins.title, 'Themes')
02324         self.assertEquals(skins.action.text,
02325                           'string:${portal_url}/@@skins-controlpanel')
02326         self.assertEquals(site.title, 'Site settings')
02327         self.assertEquals(site.action.text,
02328                           'string:${portal_url}/@@site-controlpanel')

Here is the call graph for this function:

Definition at line 3085 of file testMigrations.py.

03085 
03086     def testUpdateTopicTitle(self):
03087         topic = self.types.get('Topic')
03088         topic.title = 'Unmigrated'
03089         updateTopicTitle(self.portal, [])
03090         self.failUnless(topic.title == 'Collection')

Here is the call graph for this function:

Definition at line 3098 of file testMigrations.py.

03098 
03099     def testUpdateTopicTitleNoTool(self):
03100         self.portal._delObject('portal_types')
03101         updateTopicTitle(self.portal, [])

Here is the call graph for this function:

Definition at line 3091 of file testMigrations.py.

03091 
03092     def testUpdateTopicTitleTwice(self):
03093         topic = self.types.get('Topic')
03094         topic.title = 'Unmigrated'
03095         updateTopicTitle(self.portal, [])
03096         updateTopicTitle(self.portal, [])
03097         self.failUnless(topic.title == 'Collection')

Here is the call graph for this function:

Definition at line 2521 of file testMigrations.py.

02521 
02522     def testWebstatsJSTwice(self):
02523         # Should not break if migrated again
02524         jsreg = self.portal.portal_javascripts
02525         # unregister first
02526         jsreg.unregisterResource('webstats.js')
02527         script_ids = jsreg.getResourceIds()
02528         self.failIf('webstats.js' in script_ids)
02529         # migrate and test again
02530         addWebstatsJSFile(self.portal, [])
02531         addWebstatsJSFile(self.portal, [])
02532         script_ids = jsreg.getResourceIds()
02533         self.failUnless('webstats.js' in script_ids)
02534         if 'webstats.js' in script_ids:
02535             pos1 = jsreg.getResourcePosition('toc.js')
02536             pos2 = jsreg.getResourcePosition('webstats.js')
02537             self.failUnless((pos2 - 1) == pos1)
02538         # check if enabled 
02539         res = jsreg.getResource('webstats.js') 
02540         self.assertEqual(res.getEnabled(),True)

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

Definition at line 1327 of file testMigrations.py.

Definition at line 1328 of file testMigrations.py.

Definition at line 1332 of file testMigrations.py.

Definition at line 1329 of file testMigrations.py.

Definition at line 1330 of file testMigrations.py.

Definition at line 1331 of file testMigrations.py.


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