Back to index

plone3  3.1.7
tests.py
Go to the documentation of this file.
00001 import unittest
00002 
00003 import zope.annotation
00004 import zope.security
00005 import zope.app.security
00006 import zope.app.component
00007 import zope.app.container
00008 
00009 import plone.contentrules
00010 
00011 from zope.testing import doctest
00012 from zope.app.testing.placelesssetup import setUp, tearDown
00013 from zope.configuration.xmlconfig import XMLConfig
00014 
00015 optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
00016 
00017 def configurationSetUp(test):
00018     setUp()
00019     
00020     XMLConfig('meta.zcml', zope.security)()
00021     XMLConfig('meta.zcml', zope.app.security)()
00022     XMLConfig('meta.zcml', zope.app.component)()
00023     
00024     XMLConfig('configure.zcml', zope.app.security)()
00025     XMLConfig('configure.zcml', zope.app.container)()
00026     XMLConfig('configure.zcml', zope.annotation)()
00027     
00028     XMLConfig('configure.zcml', plone.contentrules)()
00029     # XMLConfig('meta.zcml', plone.contentrules)()
00030 
00031 def configurationTearDown(test):
00032     tearDown()
00033 
00034 def test_suite():
00035     return unittest.TestSuite((
00036         doctest.DocFileSuite(
00037             'README.txt', 
00038             setUp=configurationSetUp, 
00039             tearDown=configurationTearDown,
00040             optionflags=optionflags),
00041         doctest.DocFileSuite(
00042             'zcml.txt', 
00043             setUp=configurationSetUp, 
00044             tearDown=configurationTearDown,
00045             optionflags=optionflags),
00046         ))
00047 
00048 
00049 if __name__ == '__main__':
00050     unittest.main(defaultTest='test_suite')