[Zope-Checkins] CVS: Zope/lib/python/Products/MailHost/tests - testMailHost.py:1.4.12.1
Andreas Jung
andreas@andreas-jung.com
Mon, 7 Jul 2003 12:06:33 -0400
Update of /cvs-repository/Zope/lib/python/Products/MailHost/tests
In directory cvs.zope.org:/tmp/cvs-serv7144/lib/python/Products/MailHost/tests
Modified Files:
Tag: Zope-2_7-branch
testMailHost.py
Log Message:
- Collector #893: Mailhost: munge_header has been broken for addresses
containing the recipients full name
=== Zope/lib/python/Products/MailHost/tests/testMailHost.py 1.4 => 1.4.12.1 ===
--- Zope/lib/python/Products/MailHost/tests/testMailHost.py:1.4 Tue Mar 4 11:29:13 2003
+++ Zope/lib/python/Products/MailHost/tests/testMailHost.py Mon Jul 7 12:06:27 2003
@@ -55,6 +55,27 @@
self.failUnless(resfrom == 'me@example.com' )
+ def testAddressParser( self ):
+ msg = """To: "Name, Nick" <recipient@domain.com>, "Foo Bar" <foo@domain.com>
+CC: "Web, Jack" <jack@web.com>
+From: sender@domain.com
+Subject: This is the subject
+
+This is the message body."""
+
+ # Test Address-Parser for To & CC given in messageText
+
+ resmsg, resto, resfrom = _mungeHeaders( msg )
+ self.failUnless(resto == ['"Name, Nick" <recipient@domain.com>','"Foo Bar" <foo@domain.com>','"Web, Jack" <jack@web.com>'])
+ self.failUnless(resfrom == 'sender@domain.com' )
+
+ # Test Address-Parser for a given mto-string
+
+ resmsg, resto, resfrom = _mungeHeaders( msg, mto= '"Public, Joe" <pjoe@domain.com>, "Foo Bar" <foo@domain.com>')
+
+ self.failUnless(resto == ['"Public, Joe" <pjoe@domain.com>','"Foo Bar" <foo@domain.com>'])
+ self.failUnless(resfrom == 'sender@domain.com' )
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite( TestMailHost ) )