Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders Class Reference
Inheritance diagram for SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders:
Inheritance graph
[legend]
Collaboration diagram for SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testMessage

Public Attributes

 mailhost

Static Public Attributes

string name = 'mimetext_and_nonascii_headers'
 message = buergschaft_latin1_msg
 out = buergschaft_utf8_to_out
string subject = u'Die B\u00fcrgschaft'
string mto = u'G\u00fcnter Schiller <gunter@example.org>'
string mto_out = '=?utf-8?q?G=C3=BCnter_Schiller_?= <gunter@example.org>'
string charset = 'utf-8'
string subtype = 'plain'
string mfrom = 'from@example.org'
 mcc = None
 mbcc = None
dictionary addHeaders = {'Message-Id' : '<1>' }

Detailed Description

Definition at line 128 of file test_messages.py.


Member Function Documentation

Definition at line 47 of file test_messages.py.

00047 
00048     def afterSetUp(self):
00049         self.mailhost = SecureMailBase('securemailhost', '')

Definition at line 50 of file test_messages.py.

00050 
00051     def testMessage(self):
00052         """
00053         """
00054         send = self.mailhost.secureSend
00055         kwargs = self.addHeaders
00056         kwargs['Date'] = DateTime(0).rfc822()
00057         result = send(self.message, self.mto, self.mfrom, subject=self.subject,
00058                       mcc=self.mcc, mbcc = self.mbcc,
00059                       subtype=self.subtype, charset=self.charset,
00060                       debug=True,
00061                       **self.addHeaders)
00062 
00063         self.failUnless(isinstance(result, mail.Mail), 'Result is not a mail.Mail instance')
00064 
00065         mfrom, mto, msg = result.mfrom, result.mto, result.message
00066         self.failUnlessEqual([self.mto_out], mto)
00067         self.failUnlessEqual(self.mfrom, mfrom)
00068         self.failUnless(isinstance(msg, email.Message.Message), 'message is not a email.Message.Message instance')
00069 
00070         msgstr = msg.as_string()
00071 
00072         # compare line by line
00073         outlines = self.out.split('\n')
00074         for i, m in enumerate(msgstr.split('\n')):
00075             if len(outlines) < i:
00076                 self.fail('output has less lines than msg')
00077             o = outlines[i]
00078             self.failUnlessEqual(m, o)
00079 
00080         # compare the complete string 
00081         self.failUnlessEqual(msgstr, self.out)

Here is the call graph for this function:


Member Data Documentation

dictionary SecureMailHost.tests.test_messages.TestMessage.addHeaders = {'Message-Id' : '<1>' } [static, inherited]

Definition at line 45 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 136 of file test_messages.py.

Definition at line 48 of file test_messages.py.

Definition at line 44 of file test_messages.py.

Definition at line 43 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 130 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.mfrom = 'from@example.org' [static, inherited]

Definition at line 40 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders.mto = u'G\u00fcnter Schiller <gunter@example.org>' [static]

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 134 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders.mto_out = '=?utf-8?q?G=C3=BCnter_Schiller_?= <gunter@example.org>' [static]

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 135 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMimeTextAndNonAsciiHeaders.name = 'mimetext_and_nonascii_headers' [static]

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 129 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 131 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 133 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.subtype = 'plain' [static, inherited]

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