Ignore:
Timestamp:
Feb 10, 2010 11:27:47 AM (14 years ago)
Author:
mylan
Message:

Fix deprication warining in tests: rewrtie adding catalog index function to usage plone.indexer package

File:
1 edited

Legend:

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

    r1679 r1684  
    11import re 
    22from zope.component import queryAdapter 
     3from zope.component import provideAdapter 
     4from plone.indexer.decorator import indexer 
     5 
     6from Products.CMFCore.interfaces import IContentish 
    37from Products.Archetypes.interfaces import IBaseContent 
    48 
     
    1216        self.qi = self.portal.portal_quickinstaller 
    1317        self.qi.installProduct(PROJECT_NAME) 
    14         #self.portal.changeSkin('Plone Default') 
    1518 
    1619        self.basic_auth = 'portal_manager:secret' 
     
    9295 
    9396    def addCanonicalPathCatalogColumn(self): 
    94         from Products.CMFPlone.CatalogTool import registerIndexableAttribute 
    9597 
    96         def canonical_path(obj, portal, **kwargs): 
     98        @indexer(IContentish) 
     99        def canonical_path(obj, **kwargs): 
    97100            """Return canonical_path property for the object. 
    98101            """ 
     
    102105            return None 
    103106 
    104         registerIndexableAttribute('canonical_path', canonical_path) 
    105  
     107        provideAdapter(canonical_path, name='canonical_path') 
    106108        catalog = getToolByName(self.portal, 'portal_catalog') 
    107109        catalog.addColumn(name='canonical_path') 
Note: See TracChangeset for help on using the changeset viewer.