Skip to content

Commit f64492d

Browse files
author
Richard Jones
committed
fix unit test compatibility
1 parent 3d8a7e4 commit f64492d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/db_test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ def dummy_snd(s, to, msg, res=res) :
17931793
messages = [m], nosy = [db.user.lookup("fred")])
17941794

17951795
db.issue.nosymessage(i, m, {})
1796-
mail_msg = res["mail_msg"].getvalue()
1796+
mail_msg = str(res["mail_msg"])
17971797
self.assertEqual(res["mail_to"], ["[email protected]"])
17981798
self.failUnless("From: admin" in mail_msg)
17991799
self.failUnless("Subject: [issue1] spam" in mail_msg)

test/test_indexer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def setUp(self):
4848
self.dex.load_index()
4949

5050
def assertSeqEqual(self, s1, s2):
51-
# first argument is the db result we're testing, second is the
52-
# desired result some db results don't have iterable rows, so we
53-
# have to work around that
51+
# First argument is the db result we're testing, second is the
52+
# desired result. Some db results don't have iterable rows, so we
53+
# have to work around that.
5454
# Also work around some dbs not returning items in the expected
55-
# order. This would be *so* much easier with python2.4's sorted.
56-
s1 = list(s1)
55+
# order.
56+
s1 = list([tuple([r[n] for n in range(len(r))]) for r in s1])
5757
s1.sort()
58-
if [i for x,y in zip(s1, s2) for i,j in enumerate(y) if x[i] != j]:
58+
if s1 != s2:
5959
self.fail('contents of %r != %r'%(s1, s2))
6060

6161
def test_basics(self):

0 commit comments

Comments
 (0)