|
8 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10 | 10 | # |
11 | | -# $Id: test_mailgw.py,v 1.45 2003-04-27 02:16:47 richard Exp $ |
| 11 | +# $Id: test_mailgw.py,v 1.46 2003-05-06 21:49:20 kedder Exp $ |
12 | 12 |
|
13 | 13 | import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib |
14 | 14 | import rfc822 |
|
22 | 22 | # import rfc822 as email |
23 | 23 |
|
24 | 24 | from roundup.mailgw import MailGW, Unauthorized, uidFromAddress |
25 | | -from roundup import init, instance |
| 25 | +from roundup import init, instance, rfc2822 |
26 | 26 |
|
27 | 27 | # TODO: make this output only enough equal lines for context, not all of |
28 | 28 | # them |
@@ -952,6 +952,13 @@ def testUserCreate(self): |
952 | 952 | i = uidFromAddress( self. db, ( '', '[email protected]'), 1) |
953 | 953 | self. assertNotEqual( uidFromAddress( self. db, ( '', '[email protected]'), 1), i) |
954 | 954 |
|
| 955 | + def testRFC2822(self): |
| 956 | + ascii_header = "[issue243] This is a \"test\" - with 'quotation' marks" |
| 957 | + unicode_header = '[issue244] \xd0\xb0\xd0\xbd\xd0\xb4\xd1\x80\xd0\xb5\xd0\xb9' |
| 958 | + unicode_encoded = '=?utf-8?q?[issue244]_=D0=B0=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?=' |
| 959 | + self.assertEqual(rfc2822.encode_header(ascii_header), ascii_header) |
| 960 | + self.assertEqual(rfc2822.encode_header(unicode_header), unicode_encoded) |
| 961 | + |
955 | 962 | def suite(): |
956 | 963 | l = [unittest.makeSuite(MailgwTestCase), |
957 | 964 | ] |
|
0 commit comments