source: products/quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/tests/base.py @ 1969

Last change on this file since 1969 was 1969, checked in by liebster, 10 years ago

Initial release (paster created)

File size: 1.3 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
9@onsetup
10def 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.pfg.captcha
21    zcml.load_config('configure.zcml', quintagroup.pfg.captcha)
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.pfg.captcha')
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
33setup_product()
34ptc.setupPloneSite(products=['quintagroup.pfg.captcha'])
35
36class TestCase(ptc.PloneTestCase):
37    """Base class used for test cases
38    """
39
40class FunctionalTestCase(ptc.FunctionalTestCase):
41    """Test case class used for functional (doc-)tests
42    """
Note: See TracBrowser for help on using the repository browser.