コード例 #1
0
 def testCoreContentIconExprCleared(self):
     types = getToolByName(self.portal, 'portal_types')
     catalog = getToolByName(self.portal, 'portal_catalog')
     # Reinstate the now-empty icon expression for the Document type
     doc_icon_expr = Expression('string:${portal_url}/document_icon.png')
     types['Document'].icon_expr_object = doc_icon_expr
     front = self.portal['front-page']
     catalog.reindexObject(front)
     old_modified = front.modified()
     # Make sure the getIcon metadata column shows the "original" value
     brains = catalog(id='front-page')
     self.assertEqual(brains[0].getIcon, 'document_icon.png')
     # Run the migration
     loadMigrationProfile(self.portal, self.profile)
     updateIconMetadata(self.portal)
     # The getIcon column should now be empty
     self.assertEqual(catalog(id='front-page')[0].getIcon, '')
     self.assertEqual(front.modified(), old_modified)
コード例 #2
0
ファイル: tests.py プロジェクト: gforcada/plone.app.upgrade
 def testCoreContentIconExprCleared(self):
     types = getToolByName(self.portal, 'portal_types')
     catalog = getToolByName(self.portal, 'portal_catalog')
     # Reinstate the now-empty icon expression for the Document type
     doc_icon_expr = Expression('string:${portal_url}/document_icon.png')
     types['Document'].icon_expr_object = doc_icon_expr
     front = self.portal['front-page']
     catalog.reindexObject(front)
     old_modified = front.modified()
     # Make sure the getIcon metadata column shows the "original" value
     brains = catalog(id='front-page')
     self.assertEqual(brains[0].getIcon, 'document_icon.png')
     # Run the migration
     loadMigrationProfile(self.portal, self.profile)
     updateIconMetadata(self.portal)
     # The getIcon column should now be empty
     self.assertEqual(catalog(id='front-page')[0].getIcon, '')
     self.assertEqual(front.modified(), old_modified)