Back to index

plone3  3.1.7
tests.py
Go to the documentation of this file.
00001 import unittest
00002 
00003 from zope.component import provideAdapter
00004 from zope.component import testing
00005 
00006 from zope.testing import doctest
00007 
00008 OPTIONFLAGS = (doctest.REPORT_ONLY_FIRST_FAILURE |
00009                doctest.ELLIPSIS |
00010                doctest.NORMALIZE_WHITESPACE)
00011 
00012 
00013 def formSetUp(test):
00014     from zope.app.form.browser import TextWidget
00015     from zope.app.form.interfaces import IInputWidget
00016     from zope.publisher.interfaces.browser import IBrowserRequest
00017     from zope.schema.interfaces import ITextLine
00018     testing.setUp(test)
00019     provideAdapter(
00020         TextWidget, [ITextLine, IBrowserRequest], IInputWidget, )
00021 
00022 
00023 def test_suite():
00024     return unittest.TestSuite((
00025         doctest.DocFileSuite(
00026             'fieldsets.txt',
00027             setUp=formSetUp,
00028             tearDown=testing.tearDown,
00029             optionflags=OPTIONFLAGS),
00030         doctest.DocTestSuite(
00031             'plone.fieldsets.fieldsets'),
00032         ))
00033 
00034 if __name__ == '__main__':
00035     unittest.main(defaultTest='test_suite')