コード例 #1
0
    def setUp(self):
        from zope.component import bbb
        bbb.__warn__ = False
        bbb.service.__warn__ = False

        CleanUp.setUp(self)
        sm = getGlobalServices()
        defineService = sm.defineService
        provideService = sm.provideService
        from zope.component.interfaces import IUtilityService
        defineService('Utilities',IUtilityService)
        from zope.component.utility import GlobalUtilityService
        provideService('Utilities', GlobalUtilityService())
コード例 #2
0
    def tearDown(self):
        import shutil

        with self.current_site_directory():
            if os.path.exists('output'):
                shutil.rmtree('output')
            # This gets different names under different versions
            # of python, for some reason.
            for pname in ('.doit.db.db', 'doit.db'):
                if os.path.exists(pname):
                    os.remove(pname)

        CleanUp.cleanUp(self)
コード例 #3
0
 def tearDown(self):
     endInteraction()
     setSecurityPolicy(self.__oldpolicy)
     CleanUp.tearDown(self)
コード例 #4
0
 def setUp(self):
     CleanUp.setUp(self)
     self.__oldpolicy = setSecurityPolicy(SecurityPolicy)
     newInteraction()
コード例 #5
0
    def setUp(self):
        CleanUp.setUp(self)
        import z3c.pt

        zope.configuration.xmlconfig.file("configure.zcml", z3c.pt)
コード例 #6
0
 def tearDown(self):
     endInteraction()
     setSecurityPolicy(self.__oldpolicy)
     CleanUp.tearDown(self)
コード例 #7
0
 def setUp(self):
     CleanUp.setUp(self)
     self.__oldpolicy = setSecurityPolicy(SecurityPolicy)
     newInteraction()
コード例 #8
0
    def setUp(self):
        CleanUp.setUp(self)
        import z3c.pt

        zope.configuration.xmlconfig.file("configure.zcml", z3c.pt)
コード例 #9
0
from Products.CMFCore.tests.base.testcase import WarningInterceptor
from Products.CMFDefault.factory import addConfiguredSite
from Testing.makerequest import makerequest
try:
    import transaction
except ImportError:
    # BBB: for Zope 2.7
    from Products.CMFCore.utils import transaction
from Products.CMFCore import Skinnable

try:
    from zope.testing.cleanup import cleanUp
except:
    # BBB: for Zope 2.8
    from zope.testing.cleanup import CleanUp
    cleanup_ob = CleanUp()
    cleanUp = cleanup_ob.cleanUp


class CalendarTests(unittest.TestCase):
    def _makeOne(self, *args, **kw):
        from Products.CMFCalendar.CalendarTool import CalendarTool

        return CalendarTool(*args, **kw)

    def test_new(self):
        ctool = self._makeOne()
        self.assertEqual(ctool.getId(), 'portal_calendar')

    def test_types(self):
        ctool = self._makeOne()