1 | from Products.Five import zcml |
---|
2 | from Products.Five import fiveconfigure |
---|
3 | |
---|
4 | from Testing import ZopeTestCase as ztc |
---|
5 | |
---|
6 | from Products.PloneTestCase import PloneTestCase as ptc |
---|
7 | from Products.PloneTestCase.layer import onsetup |
---|
8 | |
---|
9 | ztc.installProduct('PloneFormGen') |
---|
10 | |
---|
11 | @onsetup |
---|
12 | def setup_product(): |
---|
13 | """Set up additional products and ZCML required to test this product. |
---|
14 | |
---|
15 | The @onsetup decorator causes the execution of this body to be deferred |
---|
16 | until the setup of the Plone site testing layer. |
---|
17 | """ |
---|
18 | |
---|
19 | # Load the ZCML configuration for this package and its dependencies |
---|
20 | |
---|
21 | fiveconfigure.debug_mode = True |
---|
22 | import quintagroup.portlet.pfg |
---|
23 | zcml.load_config('configure.zcml', quintagroup.portlet.pfg) |
---|
24 | fiveconfigure.debug_mode = False |
---|
25 | |
---|
26 | # We need to tell the testing framework that these products |
---|
27 | # should be available. This can't happen until after we have loaded |
---|
28 | # the ZCML. |
---|
29 | |
---|
30 | ztc.installPackage('quintagroup.portlet.pfg') |
---|
31 | |
---|
32 | # The order here is important: We first call the deferred function and then |
---|
33 | # let PloneTestCase install it during Plone site setup |
---|
34 | |
---|
35 | setup_product() |
---|
36 | ptc.setupPloneSite(products=['Products.PloneFormGen', |
---|
37 | 'quintagroup.portlet.pfg']) |
---|
38 | |
---|
39 | class TestCase(ptc.PloneTestCase): |
---|
40 | """Base class used for test cases |
---|
41 | """ |
---|
42 | |
---|
43 | class FunctionalTestCase(ptc.FunctionalTestCase): |
---|
44 | """Test case class used for functional (doc-)tests |
---|
45 | """ |
---|