diff test/db_test_base.py @ 5481:9a09719b0d8e

helper to allow comparing dicts and None values in Python 3
author Christof Meerwald <cmeerw@cmeerw.org>
date Wed, 01 Aug 2018 22:03:50 +0100
parents b0048969990d
children 52cb53eedf77
line wrap: on
line diff
--- a/test/db_test_base.py	Tue Jul 31 22:12:49 2018 +0100
+++ b/test/db_test_base.py	Wed Aug 01 22:03:50 2018 +0100
@@ -35,6 +35,7 @@
 from roundup.exceptions import UsageError, Reject
 
 from roundup.anypy.strings import b2s, s2b, u2s
+from roundup.anypy.cmp_ import NoneAndDictComparable
 
 from .mocknull import MockNull
 
@@ -2310,8 +2311,8 @@
                     j[1].second = float(int(j[1].second))
                 for j in rj:
                     j[1].second = float(int(j[1].second))
-                oj.sort(key = lambda x: x[:4])
-                rj.sort(key = lambda x: x[:4])
+                oj.sort(key = NoneAndDictComparable)
+                rj.sort(key = NoneAndDictComparable)
                 ae(oj, rj)
 
         # make sure the retired items are actually imported

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