Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
SecureMailHost.tests.test_headerparsing.TestHeaderParsing Class Reference

List of all members.

Public Member Functions

def afterSetUp
def test_header_cc_bcc

Public Attributes

 mailhost

Detailed Description

Definition at line 18 of file test_headerparsing.py.


Member Function Documentation

Definition at line 20 of file test_headerparsing.py.

00020 
00021     def afterSetUp(self):
00022         self.mailhost = SecureMailBase('securemailhost', '')

Definition at line 23 of file test_headerparsing.py.

00023 
00024     def test_header_cc_bcc(self):
00025         # test if cc and bcc addresses are added to the server To
00026         send = self.mailhost.secureSend
00027         
00028         msg = email.MIMEText.MIMEText('body', 'plain', 'us-ascii')
00029         mto =  "to@example.org"
00030         mfrom = "from@example.org"
00031         mbcc = "bcc@example.org"
00032         mcc = "cc@example.org"
00033         
00034         result = send(msg, mto=mto, mfrom=mfrom, subject='test',
00035                       mcc=mcc, mbcc = mbcc, debug=True)
00036 
00037         self.failUnless(isinstance(result, mail.Mail),
00038                         'Result is not a mail.Mail instance')
00039         
00040         eto = ",".join(result.mto)
00041         msg = result.message
00042         
00043         for addr in mto, mbcc, mcc:
00044             if eto.find(addr) == -1:
00045                 self.fail("%s not in %s " % (addr, eto))
00046         
00047         self.failUnlessEqual(msg['From'], mfrom)
00048         self.failUnlessEqual(msg['Cc'], mcc)
00049         self.failUnlessEqual(msg['Bcc'], mbcc)
00050         self.failUnlessEqual(msg['To'], mto)
00051 
00052 tests.append(TestHeaderParsing)
00053 

Here is the call graph for this function:


Member Data Documentation

Definition at line 21 of file test_headerparsing.py.


The documentation for this class was generated from the following file: