Changeset 1702 in products for quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py
- Timestamp:
- Feb 10, 2010 8:06:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py
r1701 r1702 11 11 from Products.PloneTestCase import PloneTestCase as ptc 12 12 from Products.PloneTestCase.layer import PloneSite 13 14 from Products.Archetypes.tests.utils import makeContent 13 15 14 16 from quintagroup.canonicalpath.interfaces import ICanonicalPath … … 44 46 def testAdapter4AT(self): 45 47 self.loginAsPortalOwner() 46 self.portal.invokeFactory('Document', id='my_doc')48 my_doc = makeContent(self.portal, portal_type='Document', id='my_doc') 47 49 self.logout() 48 my_doc = self.portal['my_doc']49 50 50 51 cpadapter = queryAdapter(my_doc, ICanonicalPath) … … 70 71 "'canonical_path' metadata not added to catalog.") 71 72 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() 72 86 73 87
Note: See TracChangeset
for help on using the changeset viewer.