source:
products/quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/tests/base.py
@
2755
| Last change on this file since 2755 was 2755, checked in by fenix, 15 years ago | |
|---|---|
|
|
| File size: 1.3 KB | |
| Rev | Line | |
|---|---|---|
| [2755] | 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 | @onsetup | |
| 10 | def setup_product(): | |
| 11 | """Set up additional products and ZCML required to test this product. | |
| 12 | ||
| 13 | The @onsetup decorator causes the execution of this body to be deferred | |
| 14 | until the setup of the Plone site testing layer. | |
| 15 | """ | |
| 16 | ||
| 17 | # Load the ZCML configuration for this package and its dependencies | |
| 18 | ||
| 19 | fiveconfigure.debug_mode = True | |
| 20 | import quintagroup.portlet.collection | |
| 21 | zcml.load_config('configure.zcml', quintagroup.portlet.collection) | |
| 22 | fiveconfigure.debug_mode = False | |
| 23 | ||
| 24 | # We need to tell the testing framework that these products | |
| 25 | # should be available. This can't happen until after we have loaded | |
| 26 | # the ZCML. | |
| 27 | ||
| 28 | ztc.installPackage('quintagroup.portlet.collection') | |
| 29 | ||
| 30 | # The order here is important: We first call the deferred function and then | |
| 31 | # let PloneTestCase install it during Plone site setup | |
| 32 | ||
| 33 | setup_product() | |
| 34 | ptc.setupPloneSite(products=['quintagroup.portlet.collection']) | |
| 35 | ||
| 36 | class TestCase(ptc.PloneTestCase): | |
| 37 | """Base class used for test cases | |
| 38 | """ | |
| 39 | ||
| 40 | class FunctionalTestCase(ptc.FunctionalTestCase): | |
| 41 | """Test case class used for functional (doc-)tests | |
| 42 | """ |
Note: See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/trac/chrome/common/qtrac_logo.png)