<style type="text/css"> <!-- li { margin: 1em } --> </style>

ZopeTestCase Readme

    The ZopeTestCase package has been developed in the hope that it will make
    testing Zope packages more convenient. It has features to support various 
    scenarios from unit-testing individual components inside a "toy" environment 
    to running regression tests against live ZEO servers.

    To add a test suite to a Zope package:

        1. Make a 'tests' subdirectory.

        2. Create an (empty) '__init__.py' in 'tests' to make it a package.

    Once a test suite has been set up, you can add test modules:

        1. Create a file with a name matching 'test*.py'.

        2. Import the 'ZopeTestCase' package as in 'from Testing import ZopeTestCase'
           and define one or more subclasses of 'ZopeTestCase.ZopeTestCase'.

        3. Define methods for the test classes.  Each method's name must start
           with 'test'.  It should test one small case, preferably using a PyUnit 
           assertion method.  Here's a minimal example::

             class ExampleTest(ZopeTestCase.ZopeTestCase):
                 def testAddition(self):
                     self.assertEqual(1+1, 2)

        4. You can add 'afterSetUp' and 'beforeTearDown' methods that are automatically
           called after the fixture has been set up and before the fixture is destroyed
           respectively. 

    Note that there is a skeleton test suite named 'testSkeleton.py' that you 
    may copy into your 'tests' directory and take it from there.

    See the sample tests in the 'ZopeTestCase' directory for details on writing 
    your own tests.
