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