Changeset 2371 in products for quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py
- Timestamp:
- May 21, 2010 11:10:30 AM (14 years ago)
- File:
-
- 1 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([
Note: See TracChangeset
for help on using the changeset viewer.