1 | import unittest |
---|
2 | import doctest |
---|
3 | |
---|
4 | from zope.interface import Interface |
---|
5 | |
---|
6 | from Products.Five import zcml |
---|
7 | from Products.Five import fiveconfigure |
---|
8 | |
---|
9 | from Products.PloneTestCase import PloneTestCase as ptc |
---|
10 | from Products.PloneTestCase.layer import PloneSite |
---|
11 | from Testing import ZopeTestCase as ztc |
---|
12 | |
---|
13 | class 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 | |
---|
28 | ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default',]) |
---|
29 | |
---|
30 | |
---|
31 | class FormlibCaptchaTestCase(ptc.FunctionalTestCase): |
---|
32 | layer = FormlibCaptchaLayer |
---|
33 | |
---|
34 | def 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 | |
---|
45 | if __name__ == '__main__': |
---|
46 | unittest.main(defaultTest='test_suite') |
---|