Back to index

plone3  3.1.7
test_doctest.py
Go to the documentation of this file.
00001 import unittest
00002 import doctest
00003 
00004 from Products.Five import zcml
00005 from Products.Five import fiveconfigure
00006 
00007 from Products.PloneTestCase import PloneTestCase as ptc
00008 from Products.PloneTestCase.layer import PloneSite
00009 from Testing import ZopeTestCase as ztc
00010 
00011 import plone.browserlayer
00012 import plone.browserlayer.tests
00013 
00014 ptc.setupPloneSite()
00015 
00016 class PloneBrowserLayerLayer(PloneSite):
00017     @classmethod
00018     def setUp(cls):
00019         fiveconfigure.debug_mode = True
00020         zcml.load_config('tests/testing.zcml', plone.browserlayer)
00021         zcml.load_config('configure.zcml', plone.browserlayer)
00022         fiveconfigure.debug_mode = False
00023         ztc.installPackage('plone.browserlayer')
00024 
00025     @classmethod
00026     def tearDown(cls):
00027         pass
00028     
00029 
00030 class PloneBrowserLayerTestCase(ptc.FunctionalTestCase):
00031     layer = PloneBrowserLayerLayer
00032 
00033 def test_suite():
00034     return unittest.TestSuite([
00035 
00036         # Demonstrate the main content types
00037         ztc.ZopeDocFileSuite(
00038             'README.txt', package='plone.browserlayer',
00039             test_class=PloneBrowserLayerTestCase,
00040             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
00041             
00042         ])
00043 
00044 if __name__ == '__main__':
00045     unittest.main(defaultTest='test_suite')