comparison test/db_test_base.py @ 7881:2184033114a0

test: fix tests python3 can't sort dict. Was getting TypeError: '<' not supported between instances of 'dict' and 'dict' on some result.sort() where result was a dict on windows. Not sure why it wasn't happening on Linux but I don't see any requirement to sort the dicts to make the test pass. Possibly sort() was a copy/paste from an earlier test where a list or something was returned.
author John Rouillard <rouilj@ieee.org>
date Thu, 18 Apr 2024 19:00:18 -0400
parents 25a03f1a8159
children aa32e3535766
comparison
equal deleted inserted replaced
7880:a4923cec0afa 7881:2184033114a0
1257 # check history removing the current quiet properties 1257 # check history removing the current quiet properties
1258 result=self.db.issue.history(new_issue) 1258 result=self.db.issue.history(new_issue)
1259 expected = {'nosy': (('+', ['1']), ('-', ['3'])), 1259 expected = {'nosy': (('+', ['1']), ('-', ['3'])),
1260 'deadline': date.Date("2016-07-30.22:39:00.000")} 1260 'deadline': date.Date("2016-07-30.22:39:00.000")}
1261 1261
1262 result.sort()
1263 print("result unquiet", result) 1262 print("result unquiet", result)
1264 (id, tx_date, user, action, args) = result[-1] 1263 (id, tx_date, user, action, args) = result[-1]
1265 # check piecewise 1264 # check piecewise
1266 self.assertEqual('1', id) 1265 self.assertEqual('1', id)
1267 self.assertEqual('1', user) 1266 self.assertEqual('1', user)
1302 result=self.db.user.set(new_user, roles="foo, bar") 1301 result=self.db.user.set(new_user, roles="foo, bar")
1303 1302
1304 # Verify last journal entry as admin is a role change 1303 # Verify last journal entry as admin is a role change
1305 # from None 1304 # from None
1306 result=self.db.user.history(new_user, skipquiet=False) 1305 result=self.db.user.history(new_user, skipquiet=False)
1307 result.sort()
1308 ''' result should end like: 1306 ''' result should end like:
1309 [ ... 1307 [ ...
1310 ('3', <Date 2017-04-15.02:06:11.482>, '1', 'set', 1308 ('3', <Date 2017-04-15.02:06:11.482>, '1', 'set',
1311 {'username': 'pete', 'assignable': False, 1309 {'username': 'pete', 'assignable': False,
1312 'supervisor': None, 'realname': None, 1310 'supervisor': None, 'realname': None,

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