From: richard Date: Fri, 13 Mar 2009 03:31:30 +0000 (+0000) Subject: fix unit test compatibility X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=17fafd0ae9ddd8373eb87689beca4d4453ed4786;p=roundup.git fix unit test compatibility git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4194 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/test/db_test_base.py b/test/db_test_base.py index 241fd95..ce3d2ee 100644 --- a/test/db_test_base.py +++ b/test/db_test_base.py @@ -1793,7 +1793,7 @@ class DBTest(MyTestCase): messages = [m], nosy = [db.user.lookup("fred")]) db.issue.nosymessage(i, m, {}) - mail_msg = res["mail_msg"].getvalue() + mail_msg = str(res["mail_msg"]) self.assertEqual(res["mail_to"], ["fred@example.com"]) self.failUnless("From: admin" in mail_msg) self.failUnless("Subject: [issue1] spam" in mail_msg) diff --git a/test/test_indexer.py b/test/test_indexer.py index 4a3369e..319536d 100644 --- a/test/test_indexer.py +++ b/test/test_indexer.py @@ -48,14 +48,14 @@ class IndexerTest(unittest.TestCase): self.dex.load_index() def assertSeqEqual(self, s1, s2): - # first argument is the db result we're testing, second is the - # desired result some db results don't have iterable rows, so we - # have to work around that + # First argument is the db result we're testing, second is the + # desired result. Some db results don't have iterable rows, so we + # have to work around that. # Also work around some dbs not returning items in the expected - # order. This would be *so* much easier with python2.4's sorted. - s1 = list(s1) + # order. + s1 = list([tuple([r[n] for n in range(len(r))]) for r in s1]) s1.sort() - if [i for x,y in zip(s1, s2) for i,j in enumerate(y) if x[i] != j]: + if s1 != s2: self.fail('contents of %r != %r'%(s1, s2)) def test_basics(self):