Back to index

plone3  3.1.7
test_doctests.py
Go to the documentation of this file.
00001 """
00002 PasswordResetTool doctests
00003 """
00004 
00005 import doctest
00006 import unittest
00007 from Testing.ZopeTestCase import FunctionalDocFileSuite
00008 from Products.PloneTestCase import PloneTestCase
00009 
00010 PloneTestCase.setupPloneSite()
00011 
00012 from Products.PasswordResetTool.tests.utils import MockMailHost
00013 
00014 
00015 class MockMailHostTestCase(PloneTestCase.FunctionalTestCase):
00016 
00017     def afterSetUp(self):
00018         self.portal._original_MailHost = self.portal.MailHost
00019         self.portal.MailHost = MockMailHost('MailHost')
00020 
00021     def beforeTearDown(self):
00022         self.portal.MailHost = self.portal._original_MailHost
00023 
00024 
00025 def test_suite():
00026     return unittest.TestSuite((
00027         FunctionalDocFileSuite('browser.txt',
00028                                optionflags = doctest.REPORT_ONLY_FIRST_FAILURE,
00029                                package='Products.PasswordResetTool.tests',
00030                                test_class=MockMailHostTestCase),
00031         ))