Ignore:
Timestamp:
Feb 10, 2010 8:06:44 PM (14 years ago)
Author:
mylan
Message:

#133: Added installation tests: test for indexer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py

    r1701 r1702  
    1111from Products.PloneTestCase import PloneTestCase as ptc 
    1212from Products.PloneTestCase.layer import PloneSite 
     13 
     14from Products.Archetypes.tests.utils import makeContent 
    1315 
    1416from quintagroup.canonicalpath.interfaces import ICanonicalPath 
     
    4446    def testAdapter4AT(self): 
    4547        self.loginAsPortalOwner() 
    46         self.portal.invokeFactory('Document', id='my_doc') 
     48        my_doc = makeContent(self.portal, portal_type='Document', id='my_doc') 
    4749        self.logout() 
    48         my_doc = self.portal['my_doc'] 
    4950 
    5051        cpadapter = queryAdapter(my_doc, ICanonicalPath) 
     
    7071            "'canonical_path' metadata not added to catalog.") 
    7172 
     73    def testIndexer(self): 
     74        self.loginAsPortalOwner() 
     75        my_doc = makeContent(self.portal, portal_type='Document', id='my_doc') 
     76        my_doc.update(title='My document') 
     77 
     78        cpadapter = queryAdapter(my_doc, ICanonicalPath) 
     79        cpmydoc = cpadapter.canonical_path() 
     80        cpbrain = self.catalog(path='/'+my_doc.absolute_url(1))[0].canonical_path 
     81        self.assertTrue(cpmydoc == cpbrain, 
     82            "Canonical Path from adapter: '%s' not equals with brains data: '%s'" % ( 
     83             cpbrain, cpmydoc)) 
     84 
     85        self.logout() 
    7286 
    7387 
Note: See TracChangeset for help on using the changeset viewer.