Premiere version : mise en route du suivi.
[auf_roundup.git] / test / test_mailer.py
1 #-*- encoding: utf8 -*-
2 import unittest
3
4 from roundup import mailer
5
6 class EncodingTestCase(unittest.TestCase):
7 def test(self):
8 a = lambda n, a, c, o: self.assertEquals(mailer.nice_sender_header(n,
9 a, c), o)
10 a('ascii', 'ascii@test.com', 'latin1', 'ascii <ascii@test.com>')
11 a(u'café', 'ascii@test.com', 'latin1',
12 '=?latin1?q?caf=E9?= <ascii@test.com>')
13 a('as"ii', 'ascii@test.com', 'latin1', '"as\\"ii" <ascii@test.com>')
14
15 def test_suite():
16 suite = unittest.TestSuite()
17 suite.addTest(unittest.makeSuite(EncodingTestCase))
18 return suite
19
20 if __name__ == '__main__':
21 runner = unittest.TextTestRunner()
22 unittest.main(testRunner=runner)
23
24 # vim: set et sts=4 sw=4 :