Back to index

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