Changeset 2371 in products
- Timestamp:
- May 21, 2010 11:10:30 AM (14 years ago)
- Location:
- quintagroup.canonicalpath/trunk/quintagroup/canonicalpath
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py
r2370 r2371 301 301 return "http://nohost/plone" 302 302 def getRelativeContentPath(self, context): 303 return "/plone/" + context.getId()303 return ("plone", context.getId()) 304 304 305 305 class BaseItem: … … 333 333 item._setProperty(PROPERTY_PATH, "/www/some/path") 334 334 self.convertor.convertIPathToLink(item) 335 # 1. check canonical link in result object 335 336 result = ICanonicalLink(item).canonical_link 336 337 expect = "http://domain.com/www/some/path" 337 338 self.assertEqual(result, expect, "Got %s canonical link, " \ 338 339 "expect: %s" % (result, expect)) 339 340 # 2. canonical path propery mast be delete from the object 341 self.assertEqual(item.hasProperty(ICanonicalPath(item).prop), False, 342 "canonical path' property not deleted from the object") 343 344 def test_convertPPathToLink(self): 345 item = GoodItem("item") 346 item._setProperty("custom_property", "/www/some/path") 347 self.convertor.convertPPathToLink(item, prop="custom_property") 348 # 1. check canonical link in result object 349 result = ICanonicalLink(item).canonical_link 350 expect = "http://domain.com/www/some/path" 351 self.assertEqual(result, expect, "Got %s canonical link, " \ 352 "expect: %s" % (result, expect)) 353 # 2. custom_property mast be deleted from the object 354 self.assertEqual(item.hasProperty("custom_property"), False, 355 "custom_property not deleted from the object") 356 340 357 def test_convertBadItems(self): 341 358 bad = NotProperyProviderItem("item") … … 383 400 self.assertEqual(logs, "", "Log not cleand-up: \"%s\"" % logs) 384 401 385 402 386 403 def test_suite(): 387 404 return unittest.TestSuite([ -
quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/upgrades.py
r2370 r2371 25 25 self.portal_url = portal_url 26 26 27 # General APIs 27 28 def getLogs(self): 28 29 self._inout.flush() … … 56 57 self._convertP2L) 57 58 59 # Service methods 58 60 def _convert(self, obj, src_iface, dst_iface, converter): 59 61 """Convert canonical from source canonical interface … … 92 94 if type(arg) in StringTypes: 93 95 adapter = DefaultPropertyAdapter(obj) 94 adap ater.prop = arg96 adapter.prop = arg 95 97 return adapter 96 98 else:
Note: See TracChangeset
for help on using the changeset viewer.