Changeset 3352 in products


Ignore:
Timestamp:
Feb 14, 2012 9:21:38 AM (9 years ago)
Author:
vmaksymiv
Message:

removed unnecessary test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/tests/testBugs.py

    r3332 r3352  
    120120 
    121121        self.assertEqual(old_title, new_title) 
    122  
    123     def test_bug_22_at_plone_org(self): 
    124         """If ICanonicalLink adapter is not found for the context object 
    125            - page rendering should not break, but only canonical link 
    126            should disappear. 
    127         """ 
    128         # XXX: in 4.0.6 version we has quick fix bug #33 
    129         # http://plone.org/products/plone-seo/issues/33 
    130         # so this test hasn't any sense for versions with this fix 
    131         try: 
    132             # try to get version from egg-info. Need for plone<3.3 
    133             seo_version = pkg_resources.get_distribution( 
    134                             'quintagroup.seoptimizer').version 
    135         except pkg_resources.DistributionNotFound: 
    136             qi = getToolByName(self.getPortal(), "portal_quickinstaller") 
    137             seo_version = qi.getProductVersion('quintagroup.seoptimizer') 
    138  
    139         exclude_versions = ("4.0.6", "4.1.0", "4.1.1") 
    140         if seo_version is not None: 
    141             for v in exclude_versions: 
    142                 if seo_version.startswith(v): 
    143                     return 
    144  
    145         curl = re.compile('<link\srel\s*=\s*"canonical"\s+' \ 
    146                           '[^>]*href\s*=\s*\"([^\"]*)\"[^>]*>', re.S | re.M) 
    147         # When adapter registered for the object - canoncal link 
    148         # present on the page 
    149         self.assertNotEqual(queryAdapter(self.my_doc, ICanonicalLink), None) 
    150  
    151         res = self.publish(path=self.mydoc_path, basic=self.basic_auth) 
    152         self.assertNotEqual(curl.search(res.getBody()), None) 
    153  
    154         # Now remove adapter from the registry -> this should : 
    155         #     - not break page on rendering; 
    156         #     - canonical link will be absent on the page 
    157         gsm = getGlobalSiteManager() 
    158         gsm.unregisterAdapter(DefaultCanonicalLinkAdapter, [ITraversable, ], 
    159                               ICanonicalLink) 
    160         self.assertEqual(queryAdapter(self.my_doc, ICanonicalLink), None) 
    161  
    162         res = self.publish(path=self.mydoc_path, basic=self.basic_auth) 
    163         self.assertEqual(curl.search(res.getBody()), None) 
    164  
    165         # register adapter back in the global site manager 
    166         gsm.registerAdapter(DefaultCanonicalLinkAdapter, [ITraversable, ], 
    167                             ICanonicalLink) 
    168122 
    169123    def test_bug_19_23_at_plone_org(self): 
Note: See TracChangeset for help on using the changeset viewer.