Changeset 2972 in products for quintagroup.canonicalpath/trunk/quintagroup
- Timestamp:
- Nov 4, 2010 8:36:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/tests.py
r2971 r2972 35 35 from quintagroup.canonicalpath.upgrades import CanonicalConvertor 36 36 37 def registerCanonicalPathInReg(): 38 import quintagroup.canonicalpath, Products.Five 39 fiveconfigure.debug_mode = True 40 zcml.load_config('meta.zcml', Products.Five) 41 zcml.load_config('configure.zcml', quintagroup.canonicalpath) 42 fiveconfigure.debug_mode = False 43 37 44 class TestCase(ptc.PloneTestCase): 38 45 class layer(PloneSite): 39 46 @classmethod 40 47 def setUp(cls): 41 import quintagroup.canonicalpath 42 fiveconfigure.debug_mode = True 43 zcml.load_config('configure.zcml', quintagroup.canonicalpath) 44 fiveconfigure.debug_mode = False 48 registerCanonicalPathInReg() 49 # import quintagroup.canonicalpath 50 # fiveconfigure.debug_mode = True 51 # zcml.load_config('configure.zcml', quintagroup.canonicalpath) 52 # fiveconfigure.debug_mode = False 45 53 46 54 ptc.setupPloneSite() … … 323 331 """Not adaptable object.""" 324 332 325 class TestConvertor(TestCase): 333 334 class TestConvertor(unittest.TestCase): 326 335 327 336 def setUp(self): 337 registerCanonicalPathInReg() 328 338 self.convertor = CanonicalConvertor("http://domain.com") 329 339 … … 358 368 self.convertor.convertIPathToLink(bad) 359 369 result = self.convertor.getLogs() 360 expect = "ERROR: exceptions.AttributeError: " \ 361 "NotPropertyProviderItem instance has no attribute 'hasProperty'" 370 expect = "NotPropertyProviderItem instance has no attribute 'hasProperty'" 362 371 self.assertEqual(expect in result, True, "Wrong log: %s" % result) 363 372 … … 365 374 self.convertor.convertIPathToLink(bad) 366 375 result = self.convertor.getLogs() 367 expect = " ERROR: zope.component.interfaces.ComponentLookupError:"376 expect = "zope.component.interfaces.ComponentLookupError" 368 377 self.assertEqual(expect in result, True, "Wrong log: %s" % result) 369 378 … … 399 408 400 409 401 class TestAdaptersRegistration( TestCase):410 class TestAdaptersRegistration(unittest.TestCase): 402 411 """Test of default adapters registration.""" 403 412 404 413 def setUp(self): 414 registerCanonicalPathInReg() 405 415 self.cant = "Can't get \"%s\" adapter for object, which implement: " 406 416 self.doget = "Get \"%s\" adapter for object, which implement: "
Note: See TracChangeset
for help on using the changeset viewer.