# HG changeset patch # User Richard Jones # Date 1219110059 0 # Node ID 3dec28d96583ac7fb3ca4cbf47192051a527deb2 # Parent e437f403131026ab5feb499c22e07b1661090cb4 fix some unit tests for python2.3 diff -r e437f4031310 -r 3dec28d96583 test/db_test_base.py --- a/test/db_test_base.py Tue Aug 19 01:33:00 2008 +0000 +++ b/test/db_test_base.py Tue Aug 19 01:40:59 2008 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: db_test_base.py,v 1.100 2008-08-19 00:52:01 richard Exp $ +# $Id: db_test_base.py,v 1.101 2008-08-19 01:40:59 richard Exp $ import unittest, os, shutil, errno, imp, sys, time, pprint, sets, base64, os.path @@ -280,7 +280,7 @@ # try a couple of the built-in iterable types to make # sure that we accept them and handle them properly # try a set as input for the multilink - nid = self.db.issue.create(title="spam", nosy=set(u1)) + nid = self.db.issue.create(title="spam", nosy=sets.Set(u1)) if commit: self.db.commit() self.assertEqual(self.db.issue.get(nid, "nosy"), [u1]) self.assertRaises(TypeError, self.db.issue.set, nid, @@ -290,7 +290,7 @@ if commit: self.db.commit() self.assertEqual(self.db.issue.get(nid, "nosy"), []) # make sure we accept a frozen set - self.db.issue.set(nid, nosy=frozenset([u1,u2])) + self.db.issue.set(nid, nosy=sets.Set([u1,u2])) if commit: self.db.commit() l = [u1,u2]; l.sort() m = self.db.issue.get(nid, "nosy"); m.sort() @@ -1794,9 +1794,9 @@ self.failUnless("New submission from admin" in mail_msg) self.failUnless("one two" in mail_msg) self.failIf("File 'test1.txt' not attached" in mail_msg) - self.failUnless(base64.b64encode("xxx") in mail_msg) + self.failUnless(base64.encodestring("xxx").rstrip() in mail_msg) self.failUnless("File 'test2.txt' not attached" in mail_msg) - self.failIf(base64.b64encode("yyy") in mail_msg) + self.failIf(base64.encodestring("yyy").rstrip() in mail_msg) finally : Mailer.smtp_send = backup diff -r e437f4031310 -r 3dec28d96583 test/test_mailgw.py --- a/test/test_mailgw.py Tue Aug 19 01:33:00 2008 +0000 +++ b/test/test_mailgw.py Tue Aug 19 01:40:59 2008 +0000 @@ -8,7 +8,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: test_mailgw.py,v 1.95 2008-08-19 01:10:35 richard Exp $ +# $Id: test_mailgw.py,v 1.96 2008-08-19 01:40:59 richard Exp $ # TODO: test bcc @@ -682,7 +682,10 @@ This is a followup '''), nodeid) - # now try a longer interval + + + def testFollowupTitleMatchInterval(self): + nodeid = self.doNewIssue() self.db.config.MAILGW_SUBJECT_CONTENT_MATCH = 'creation +1d' self.assertEqual(self._handle_mail('''Content-Type: text/plain; charset="iso-8859-1"