source: products/quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/tests/test_doctests.py @ 2801

Last change on this file since 2801 was 2801, checked in by mylan, 14 years ago

#195: Prepared doctests infrastructure

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1import unittest
2import doctest
3
4from zope.interface import Interface
5
6from Products.Five import zcml
7from Products.Five import fiveconfigure
8
9from Products.PloneTestCase import PloneTestCase as ptc
10from Products.PloneTestCase.layer import PloneSite
11from Testing import ZopeTestCase as ztc
12
13class FormlibCaptchaLayer(PloneSite):
14    @classmethod
15    def setUp(cls):
16        fiveconfigure.debug_mode = True
17        import quintagroup.captcha.core
18        import quintagroup.formlib.captcha
19        zcml.load_config('configure.zcml', quintagroup.formlib.captcha)
20        zcml.load_config('tests.zcml', quintagroup.formlib.captcha.tests)
21        fiveconfigure.debug_mode = False
22        ztc.installPackage('quintagroup.captcha.core')
23
24    @classmethod
25    def tearDown(cls):
26        pass
27   
28ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default',])
29
30
31class FormlibCaptchaTestCase(ptc.FunctionalTestCase):
32    layer = FormlibCaptchaLayer
33
34def test_suite():
35    return unittest.TestSuite([
36
37        # Demonstrate the main content types
38        ztc.ZopeDocFileSuite(
39            'README.txt', package='quintagroup.formlib.captcha',
40            test_class=FormlibCaptchaTestCase,
41            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
42           
43        ])
44
45if __name__ == '__main__':
46    unittest.main(defaultTest='test_suite')
Note: See TracBrowser for help on using the repository browser.