Back to index

plone3  3.1.7
testing.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
00004 #
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE.
00011 #
00012 ##############################################################################
00013 """ Unit test layers.
00014 
00015 $Id: testing.py 80863 2007-10-13 16:02:33Z shh $
00016 """
00017 
00018 from Products.Five import zcml
00019 from zope.testing.cleanup import cleanUp
00020 
00021 from Products.CMFCore.testing import _DUMMY_ZCML
00022 
00023 
00024 class ExportImportZCMLLayer:
00025 
00026     @classmethod
00027     def setUp(cls):
00028         import Products.Five
00029         import Products.GenericSetup
00030         import Products.CMFCore
00031         import Products.CMFCore.exportimport
00032         import Products.DCWorkflow
00033 
00034         zcml.load_config('meta.zcml', Products.Five)
00035         zcml.load_config('configure.zcml', Products.Five)
00036         zcml.load_config('configure.zcml', Products.GenericSetup)
00037         zcml.load_config('tool.zcml', Products.CMFCore)
00038         zcml.load_config('configure.zcml', Products.CMFCore.exportimport)
00039         zcml.load_config('tool.zcml', Products.DCWorkflow)
00040         zcml.load_config('exportimport.zcml', Products.DCWorkflow)
00041         zcml.load_string(_DUMMY_ZCML)
00042 
00043     @classmethod
00044     def tearDown(cls):
00045         cleanUp()
00046 
00047 
00048 # Derive from ZopeLite layer if available
00049 try:
00050     from Testing.ZopeTestCase.layer import ZopeLite
00051 except ImportError:
00052     pass # Zope < 2.11
00053 else:
00054     ExportImportZCMLLayer.__bases__ = (ZopeLite,)
00055