Ignore:
Timestamp:
6 Aug 2011, 11:11:41 (13 years ago)
Author:
uli
Message:

Implement a new logging technique and use it.
Details are explained in waeup.sirp.utils.logger.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py

    r6443 r6578  
    2828import unittest
    2929from StringIO import StringIO
    30 from zope.app.testing.functional import FunctionalTestCase
    31 from zope.component.hooks import setSite, clearSite
     30from zope.component.hooks import setSite
    3231from zope.interface.verify import verifyClass, verifyObject
    33 from zope.site import LocalSiteManager
    3432from waeup.sirp.app import University
    3533from waeup.sirp.applicants import (
     
    4038    ApplicantsRoot, ApplicantsPlugin,
    4139    )
    42 from waeup.sirp.testing import FunctionalLayer
     40from waeup.sirp.testing import (
     41    FunctionalLayer, FunctionalTestCase, get_all_loggers, remove_new_loggers,
     42    remove_logger)
    4343
    4444
     
    5454    def setUp(self):
    5555        super(ApplicantsRootTestCase, self).setUp()
    56 
     56        remove_logger('waeup.sirp.app.applicants')
     57        self.old_loggers = get_all_loggers()
    5758        # Setup a sample site for each test
     59
     60        # Prepopulate the ZODB...
    5861        app = University()
    59         self.dc_root = tempfile.mkdtemp()
    60         app['datacenter'].setStoragePath(self.dc_root)
    61 
    62         # Prepopulate the ZODB...
    6362        self.getRootFolder()['app'] = app
    6463        self.app = self.getRootFolder()['app']
    6564        setSite(self.app)
     65
     66        self.dc_root = tempfile.mkdtemp()
     67        app['datacenter'].setStoragePath(self.dc_root)
     68
    6669        return
    6770
    6871    def tearDown(self):
    6972        super(ApplicantsRootTestCase, self).tearDown()
     73        remove_new_loggers(self.old_loggers)
    7074        shutil.rmtree(self.dc_root)
    7175        return
Note: See TracChangeset for help on using the changeset viewer.