Back to index

plone3  3.1.7
Classes | Functions | Variables
borg.localrole.tests Namespace Reference

Classes

class  SimpleLocalRoleProvider
class  DummyUser

Functions

def setup_product
def test_suite

Variables

 TEST_INSTALL = True

Function Documentation

Set up the additional products required for this package.

The @onsetup decorator causes the execution of this body to be deferred
until the setup of the Plone site testing layer.

Definition at line 59 of file tests.py.

00059 
00060 def setup_product():
00061     """Set up the additional products required for this package.
00062     
00063     The @onsetup decorator causes the execution of this body to be deferred
00064     until the setup of the Plone site testing layer.
00065     """
00066     
00067     # Load the ZCML configuration for dependent packages.
00068     
00069     fiveconfigure.debug_mode = True
00070     zcml.load_config('configure.zcml', borg.localrole)
00071     fiveconfigure.debug_mode = False
00072     
00073     # We need to tell the testing framework that these products
00074     # should be available. This can't happen until after we have loaded
00075     # the ZCML.
00076     if TEST_INSTALL:
00077         ztc.installPackage('borg.localrole')
00078     
00079 # The order here is important: We first call the (deferred) function which
00080 # installs the products we need.Then, we let PloneTestCase set up this 
00081 # product on installation.
00082 
00083 setup_product()
00084 ptc.setupPloneSite(products=['borg.localrole'])

Definition at line 85 of file tests.py.

00085 
00086 def test_suite():
00087     suite = []
00088 
00089     if TEST_INSTALL:
00090         suite.extend([
00091             ztc.ZopeDocFileSuite(
00092                         'README.txt', package='borg.localrole',
00093                         test_class=ptc.FunctionalTestCase,
00094                         optionflags=(doctest.ELLIPSIS |
00095                                      doctest.NORMALIZE_WHITESPACE)),
00096             ztc.ZopeDocFileSuite(
00097                         'bbb.txt', package='borg.localrole.bbb',
00098                         test_class=ptc.FunctionalTestCase,
00099                         optionflags=(doctest.ELLIPSIS |
00100                                      doctest.NORMALIZE_WHITESPACE)),
00101             ])
00102 
00103     # Add the tests that register adapters at the end
00104 
00105     suite.extend([
00106         zope.testing.doctest.DocTestSuite(borg.localrole.workspace,
00107             setUp=placelesssetup.setUp(),
00108             tearDown=placelesssetup.tearDown(),
00109             optionflags=zope.testing.doctest.ELLIPSIS |
00110                         zope.testing.doctest.NORMALIZE_WHITESPACE),
00111 
00112         zope.testing.doctest.DocTestSuite(factory_adapter),
00113         zope.testing.doctest.DocTestSuite(default_adapter),
00114         ])
00115 
00116 
00117     return unittest.TestSuite(suite)


Variable Documentation

Definition at line 21 of file tests.py.