zerver/tests/tests.py: Fix non-deterministic failure.

Replace occurences of list(d.keys()) by sorted(d.keys()).
This commit is contained in:
Eklavya Sharma 2016-07-10 04:11:07 +05:30 committed by Tim Abbott
parent 1f3ce7cf38
commit 801bcdd956
1 changed files with 1 additions and 1 deletions

View File

@ -1253,7 +1253,7 @@ class UserPresenceTests(AuthedTestCase):
json = ujson.loads(result.content)
self.assertEqual(json['presences'][email][client]['status'], 'idle')
self.assertEqual(json['presences']['hamlet@zulip.com'][client]['status'], 'idle')
self.assertEqual(list(json['presences'].keys()), ['hamlet@zulip.com', 'othello@zulip.com'])
self.assertEqual(sorted(json['presences'].keys()), ['hamlet@zulip.com', 'othello@zulip.com'])
newer_timestamp = json['presences'][email][client]['timestamp']
self.assertGreaterEqual(newer_timestamp, timestamp)