test_events: Sort subscribers list.

The subscribers list is appended to in `peer_add` events with not
regard for preserving the ordering, and ordering isn't really
important here, so it seems best to just sort it in these checks.
This commit is contained in:
Kartik Maji 2016-06-30 16:52:51 -07:00 committed by Tim Abbott
parent 1cbd39b768
commit a32167d921
1 changed files with 2 additions and 0 deletions

View File

@ -258,6 +258,8 @@ class EventsRegisterTest(AuthedTestCase):
def normalize(state):
# type: (Dict[str, Any]) -> None
state['realm_users'] = {u['email']: u for u in state['realm_users']}
for u in state['subscriptions']:
u['subscribers'].sort()
state['subscriptions'] = {u['name']: u for u in state['subscriptions']}
state['unsubscribed'] = {u['name']: u for u in state['unsubscribed']}
if 'realm_bots' in state: