Changeset 2972 in products


Ignore:
Timestamp:
Nov 4, 2010 8:36:57 PM (13 years ago)
Author:
mylan
Message:

#234: Fixed absence of total string

File:
1 edited

Legend:

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

    r2971 r2972  
    3535from quintagroup.canonicalpath.upgrades import CanonicalConvertor 
    3636 
     37def 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 
    3744class TestCase(ptc.PloneTestCase): 
    3845    class layer(PloneSite): 
    3946        @classmethod 
    4047        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 
    4553 
    4654ptc.setupPloneSite() 
     
    323331    """Not adaptable object.""" 
    324332 
    325 class TestConvertor(TestCase): 
     333 
     334class TestConvertor(unittest.TestCase): 
    326335 
    327336    def setUp(self): 
     337        registerCanonicalPathInReg() 
    328338        self.convertor = CanonicalConvertor("http://domain.com") 
    329339 
     
    358368        self.convertor.convertIPathToLink(bad) 
    359369        result = self.convertor.getLogs() 
    360         expect = "ERROR: exceptions.AttributeError: " \ 
    361                  "NotPropertyProviderItem instance has no attribute 'hasProperty'" 
     370        expect = "NotPropertyProviderItem instance has no attribute 'hasProperty'" 
    362371        self.assertEqual(expect in result, True, "Wrong log: %s" % result) 
    363372 
     
    365374        self.convertor.convertIPathToLink(bad) 
    366375        result = self.convertor.getLogs() 
    367         expect = "ERROR: zope.component.interfaces.ComponentLookupError: " 
     376        expect = "zope.component.interfaces.ComponentLookupError" 
    368377        self.assertEqual(expect in result, True, "Wrong log: %s" % result) 
    369378 
     
    399408 
    400409 
    401 class TestAdaptersRegistration(TestCase): 
     410class TestAdaptersRegistration(unittest.TestCase): 
    402411    """Test of default adapters registration.""" 
    403412 
    404413    def setUp(self): 
     414        registerCanonicalPathInReg() 
    405415        self.cant = "Can't get \"%s\" adapter for object, which implement: " 
    406416        self.doget = "Get \"%s\" adapter for object, which implement: " 
Note: See TracChangeset for help on using the changeset viewer.