Changeset 1849 in products for quintagroup.seoptimizer/branches
- Timestamp:
- Mar 4, 2010 9:00:53 PM (14 years ago)
- Location:
- quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/browser.txt
r1833 r1849 53 53 =============================== 54 54 55 >>> self.qi = self.portal.portal_quickinstaller 56 >>> self.sp = self.portal.portal_properties.seo_properties 57 >>> self.object_tabs = self.portal.portal_actions.object 58 >>> self.ps = self.portal.portal_setup 59 55 60 First uninstall product, if it is already installed: 56 61 57 62 >>> from quintagroup.seoptimizer.config import PROJECT_NAME 58 >>> self.qi = self.portal.portal_quickinstaller59 63 >>> if self.qi.isProductInstalled(PROJECT_NAME): 60 64 ... self.qi.uninstallProducts([PROJECT_NAME,]) … … 68 72 >>> self.qi.installProduct(PROJECT_NAME) 69 73 'Ran all install steps.' 70 >>> self.sp = self.portal.portal_properties.seo_properties71 >>> self.object_tabs = self.portal.portal_actions.object72 74 >>> self.portal.portal_actions.object.get('SEOProperties', None) is not None 73 75 True … … 90 92 91 93 Test reinstallation 'SEO Properties' action 94 For perform all upgrade steps on re-installation, earlier version of profile must be set. 92 95 93 96 >>> browser.open('http://nohost/plone/front-page') 94 97 >>> "SEO Properties" in browser.contents 95 98 False 99 >>> self.ps.setLastVersionForProfile('quintagroup.seoptimizer:default', '2.0.0') 96 100 >>> self.qi.reinstallProducts((PROJECT_NAME,)) 97 101 >>> self.portal.portal_actions.object.get('SEOProperties', None) is not None -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/config.py
r1826 r1849 14 14 'meta_content' : ''} 15 15 ] 16 DEFAULT_METATAGS_ORDER = ['DC.contributors', 'DC.creator', 'DC.date.created', 17 'DC.date.modified','DC.description', 'DC.distribution', 18 'DC.format', 'DC.language', 'DC.publisher', 'DC.rights', 19 'DC.subject', 'DC.type', 'description', 'distribution', 20 'keywords', 'robots'] 21 DEFAULT_METATAGS_ORDER.sort() 16 22 VIEW_METATAGS = ['DC.creator', 'DC.format', 'DC.date.modified', 'DC.date.created', 'DC.type', 17 23 'DC.distribution', 'description', 'keywords', 'robots', 'distribution'] 18 19 24 GLOBAL_CUSTOM_METATAGS = {'default_custom_metatags':'metatag1|global_metatag1value\nmetatag4|global_metatag4value'} 20 25 … … 31 36 qSEO_FOLDER = [] 32 37 qSEO_TYPES = qSEO_CONTENT + qSEO_FOLDER 38 39 SEO_CONTENT = ['File', 'Document', 'News Item'] 40 CONTENTTYPES_WITH_SEOACTION = ['File', 'Document', 'News Item', 'Folder', 'Event'] 41 CONTENTTYPES_WITH_SEOACTION.sort() -
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/testInstallation.py
r1837 r1849 143 143 "Not added 'SEOProperties' action") 144 144 145 class TestReinstallation(TestCase): 146 147 def afterSetUp(self): 148 self.qi = self.portal.portal_quickinstaller 149 self.types_tool = getToolByName(self.portal, 'portal_types') 150 self.setup_tool = getToolByName(self.portal, 'portal_setup') 151 self.pprops_tool = getToolByName(self.portal, 'portal_properties') 152 self.seoprops_tool = getToolByName(self.pprops_tool, 'seo_properties', None) 153 # Set earlier version profile (2.0.0) for using upgrade steps 154 self.setup_tool.setLastVersionForProfile('%s:default' % PROJECT_NAME, '2.0.0') 155 156 def testChangeDomain(self): 157 # Test changed of content type's domain from 'quintagroup.seoptimizer' to 'plone' 158 for type in SEO_CONTENT: 159 self.types_tool.getTypeInfo(type).i18n_domain = 'quintagroup.seoptimizer' 160 self.qi.reinstallProducts([PROJECT_NAME]) 161 for type in SEO_CONTENT: 162 self.assertEqual(self.types_tool.getTypeInfo(type).i18n_domain, 'plone', 163 "Not changed of %s content type's domain to 'plone'" % type) 164 165 def testCutItemsMetatagsOrderList(self): 166 # Test changed format metatags order list from "metaname accessor" to "metaname" 167 value, expect_mto = ['name1 accessor1', 'name2 accessor2'], ['name1','name2'] 168 self.seoprops_tool.manage_changeProperties(metatags_order=value) 169 self.qi.reinstallProducts([PROJECT_NAME]) 170 mto = list(self.seoprops_tool.getProperty('metatags_order')) 171 mto.sort() 172 self.assertEqual(mto, expect_mto, 173 "Not changed format metatags order list from \"metaname accessor\" to"\ 174 " \"metaname\". %s != %s" %(mto, expect_mto)) 175 176 def testAddMetatagsOrderList(self): 177 # Test added metatags order list if it was not there before 178 self.seoprops_tool.manage_delProperties(['metatags_order']) 179 self.qi.reinstallProducts([PROJECT_NAME]) 180 mto = list(self.seoprops_tool.getProperty('metatags_order')) 181 mto.sort() 182 self.assertEqual(mto, DEFAULT_METATAGS_ORDER, 183 "Not added metatags order list with default values."\ 184 "%s != %s" %(mto, DEFAULT_METATAGS_ORDER)) 185 186 def testMigrationActions(self): 187 # Test migrated actions from portal_types action to seoproperties tool 188 self.seoprops_tool.content_types_with_seoproperties = () 189 190 # Add seoaction to content type for testing 191 for type in CONTENTTYPES_WITH_SEOACTION: 192 self.types_tool.getTypeInfo(type).addAction(id='seo_properties', 193 name='SEO Properties', 194 action=None, 195 condition=None, 196 permission=(u'Modify portal content',), 197 category='object', 198 visible=True, 199 icon_expr=None, 200 link_target=None, 201 ) 202 # Check presence seoaction in content type 203 seoaction = [act.id for act in self.types_tool.getTypeInfo(type).listActions() 204 if act.id == 'seo_properties'] 205 self.assertEqual(bool(seoaction), True, 206 "Not added seoaction to content type %s for testing" % type) 207 208 self.qi.reinstallProducts([PROJECT_NAME]) 209 210 # Check presence seoaction in content type 211 for type in CONTENTTYPES_WITH_SEOACTION: 212 seoaction = [act.id for act in self.types_tool.getTypeInfo(type).listActions() 213 if act.id == 'seo_properties'] 214 self.assertEqual(bool(seoaction), False, 215 "Not removed seoaction in content type %s" % type) 216 217 # Check added content type names in seo properties tool if content types have seoaction 218 ctws = list(self.seoprops_tool.content_types_with_seoproperties) 219 ctws.sort() 220 self.assertEqual(ctws, CONTENTTYPES_WITH_SEOACTION, 221 "Not added content type names in seo properties tool if content types have seoaction."\ 222 " %s != %s" %(ctws, CONTENTTYPES_WITH_SEOACTION)) 223 145 224 146 225 def test_suite(): … … 150 229 suite.addTest(makeSuite(TestInstallation)) 151 230 suite.addTest(makeSuite(TestUninstallation)) 231 suite.addTest(makeSuite(TestReinstallation)) 152 232 return suite
Note: See TracChangeset
for help on using the changeset viewer.