Mercurial > p > roundup > code
view test/test_mailer.py @ 4423:579802067547
Fix charset of first text-part of outgoing multipart messages...
...thanks Dirk Geschke for reporting, see
http://thread.gmane.org/gmane.comp.bug-tracking.roundup.user/10223
This also adds some regression tests to test incoming latin1 and
outgoing single- and multipart utf-8 and latin1 messages
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 04 Oct 2010 12:56:37 +0000 |
| parents | 94ee533613ac |
| children | 182d8c41a3aa |
line wrap: on
line source
#-*- encoding: utf8 -*- import unittest from roundup import mailer class EncodingTestCase(unittest.TestCase): def test(self): a = lambda n, a, c, o: self.assertEquals(mailer.nice_sender_header(n, a, c), o) a('ascii', 'ascii@test.com', 'latin1', 'ascii <ascii@test.com>') a(u'café', 'ascii@test.com', 'latin1', '=?latin1?q?caf=E9?= <ascii@test.com>') a('as"ii', 'ascii@test.com', 'latin1', '"as\\"ii" <ascii@test.com>') def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(EncodingTestCase)) return suite if __name__ == '__main__': runner = unittest.TextTestRunner() unittest.main(testRunner=runner) # vim: set et sts=4 sw=4 :
