Mercurial > p > roundup > code
view test/test_mailer.py @ 4579:ba4c632143f6
issue2550535 Fix keep_quoted_text=yes setting.
In some cases even when keep_quoted_text=yes is configured we would
strip quoted sections. This hit the python bug-tracker especially for
python interpreter examples with leading '>>>' strings. The fix is
slightly different compared to the proposal as this broke
keep_quoted_text=no in certain cases. We also fix a bug where
keep_quoted_text=no would drop the last line of a non-quoted section if
there wasn't an empty line between the next quotes.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Thu, 05 Jan 2012 20:55:47 +0100 |
| parents | 182d8c41a3aa |
| children | 364c54991861 |
line wrap: on
line source
#-*- encoding: utf8 -*- import unittest from roundup import mailer class EncodingTestCase(unittest.TestCase): def testEncoding(self): a = lambda n, a, c, o: self.assertEquals(mailer.nice_sender_header(n, a, c), o) a('ascii', 'ascii@test.com', 'iso8859-1', 'ascii <ascii@test.com>') a(u'café', 'ascii@test.com', 'iso8859-1', '=?iso8859-1?q?caf=E9?= <ascii@test.com>') a('as"ii', 'ascii@test.com', 'iso8859-1', '"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 :
