source: products/quintagroup.portlet.pfg/trunk/quintagroup/portlet/pfg/tests/base.py @ 2816

Last change on this file since 2816 was 2816, checked in by fenix, 14 years ago
  • added tests;
  • fixed bugs;
  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1from Products.Five import zcml
2from Products.Five import fiveconfigure
3
4from Testing import ZopeTestCase as ztc
5
6from Products.PloneTestCase import PloneTestCase as ptc
7from Products.PloneTestCase.layer import onsetup
8
9ztc.installProduct('PloneFormGen')
10
11@onsetup
12def 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
35setup_product()
36ptc.setupPloneSite(products=['Products.PloneFormGen',
37                             'quintagroup.portlet.pfg'])
38
39class TestCase(ptc.PloneTestCase):
40    """Base class used for test cases
41    """
42
43class FunctionalTestCase(ptc.FunctionalTestCase):
44    """Test case class used for functional (doc-)tests
45    """
Note: See TracBrowser for help on using the repository browser.