view test/test_rfc2822.py @ 3692:8e52157e2073

More transitive-property work. - Add some more tests that break the current SQL backend implementation for transitive properties. One of them looks like a Postgres bug to me -- I'm getting: """ProgrammingError: ERROR: relation "_user2" does not exist""" where _user2 is an alias for _user in the from clause (but _user2 is used in a left outer join). The other SQL backends are fine with the generated SQL. Hmm. One of the reasons for packing sort and search attributes into the same data structure was the optimized SQL: not creating a left outer join for attributes that are already in a normal join (from/where clause). I'll check if I can instead leave the attribute from the from-clause instead (or if I'm then getting errors from the other backends, Postgres seems fine with that).
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 30 Aug 2006 08:50:44 +0000
parents 97f9fc0bc0ea
children
line wrap: on
line source

from roundup.rfc2822 import decode_header, encode_header

import unittest, time
 
class RFC2822TestCase(unittest.TestCase):
    def testDecode(self):
        src = 'Re: [it_issue3] '\
            '=?ISO-8859-1?Q?Ren=E9s_[resp=3Dg=2Cstatus=3D?= '\
            '=?ISO-8859-1?Q?feedback]?='
        result = 'Re: [it_issue3] Ren\xc3\xa9s [resp=g,status=feedback]'
        self.assertEqual(decode_header(src), result)

        src = 'Re: [it_issue3]'\
            ' =?ISO-8859-1?Q?Ren=E9s_[resp=3Dg=2Cstatus=3D?=' \
            ' =?ISO-8859-1?Q?feedback]?='
        result = 'Re: [it_issue3] Ren\xc3\xa9s [resp=g,status=feedback]'
        self.assertEqual(decode_header(src), result)

    def testEncode(self):
        src = 'Re: [it_issue3] Ren\xc3\xa9s [status=feedback]'
        result = '=?utf-8?q?Re:_[it=5Fissue3]_Ren=C3=A9s_[status=3Dfeedback]?='
        self.assertEqual(encode_header(src), result)

        src = 'Was machen\xc3\xbc und Fragezeichen?'
        result = '=?utf-8?q?Was_machen=C3=BC_und_Fragezeichen=3F?='
        self.assertEqual(encode_header(src), result)

def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(RFC2822TestCase))
    return suite

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