[322] | 1 | import unittest |
---|
| 2 | |
---|
| 3 | from zope.testing import doctestunit |
---|
| 4 | from zope.component import testing |
---|
| 5 | from Testing import ZopeTestCase as ztc |
---|
| 6 | |
---|
| 7 | from Products.Five import zcml |
---|
| 8 | from Products.Five import fiveconfigure |
---|
| 9 | from Products.PloneTestCase import PloneTestCase as ptc |
---|
| 10 | from Products.PloneTestCase.layer import PloneSite |
---|
| 11 | ptc.setupPloneSite() |
---|
| 12 | |
---|
| 13 | import quintagroup.ploneformgen.readonlystringfield |
---|
| 14 | |
---|
| 15 | class TestCase(ptc.PloneTestCase): |
---|
| 16 | class layer(PloneSite): |
---|
| 17 | @classmethod |
---|
| 18 | def setUp(cls): |
---|
| 19 | fiveconfigure.debug_mode = True |
---|
| 20 | zcml.load_config('configure.zcml', |
---|
| 21 | quintagroup.ploneformgen.readonlystringfield) |
---|
| 22 | fiveconfigure.debug_mode = False |
---|
| 23 | |
---|
| 24 | @classmethod |
---|
| 25 | def tearDown(cls): |
---|
| 26 | pass |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | def test_suite(): |
---|
| 30 | return unittest.TestSuite([ |
---|
| 31 | |
---|
| 32 | # Unit tests |
---|
| 33 | #doctestunit.DocFileSuite( |
---|
| 34 | # 'README.txt', package='quintagroup.ploneformgen.readonlystringfield', |
---|
| 35 | # setUp=testing.setUp, tearDown=testing.tearDown), |
---|
| 36 | |
---|
| 37 | #doctestunit.DocTestSuite( |
---|
| 38 | # module='quintagroup.ploneformgen.readonlystringfield.mymodule', |
---|
| 39 | # setUp=testing.setUp, tearDown=testing.tearDown), |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | # Integration tests that use PloneTestCase |
---|
| 43 | #ztc.ZopeDocFileSuite( |
---|
| 44 | # 'README.txt', package='quintagroup.ploneformgen.readonlystringfield', |
---|
| 45 | # test_class=TestCase), |
---|
| 46 | |
---|
| 47 | #ztc.FunctionalDocFileSuite( |
---|
| 48 | # 'browser.txt', package='quintagroup.ploneformgen.readonlystringfield', |
---|
| 49 | # test_class=TestCase), |
---|
| 50 | |
---|
| 51 | ]) |
---|
| 52 | |
---|
| 53 | if __name__ == '__main__': |
---|
| 54 | unittest.main(defaultTest='test_suite') |
---|