view test/test_mailer.py @ 4377:b6f1aaba4827

Small documentation update regarding debugging aids: - doc/debugging.txt: removed HYPERDBDEBUG and HYPERDBTRACE and replaced it with the text for SENDMAILDEBUG from doc/developers.txt. A short code inspection showed that to be correct. - refered to debugging.txt from developers.txt to have one unique place for documenting debugging aids. - Clarified for SENDMAILDEBUG that no email will be send if it is set.
author Bernhard Reiter <Bernhard.Reiter@intevation.de>
date Mon, 10 May 2010 07:08:11 +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 :

Roundup Issue Tracker: http://roundup-tracker.org/