view test/test_mailer.py @ 4841:3ff1a288fb9c

issue2550583, issue2550635 Do not limit results with Xapian indexer Other indexer backends do not limit the number of results. Add test with searching for 123 entries on all backends, more should not be used, because the slower backends would take too much time. enquire.get_mset was limited to 10 results and since the results can be messages instead of issues, the 10 results could even be just one issue if there were many messages matching the search term before searching the messages of other issues. Additionally the few results could be filtered by other attributes, e.g. only showing open issues, which caused even less matches.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 21 Oct 2013 12:56:28 +0200
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 :

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