diff options
author | Erik Johnston <erik@matrix.org> | 2020-01-15 14:59:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-15 14:59:33 +0000 |
commit | 28c98e51ffa166bd717646b0b34228e59f253485 (patch) | |
tree | 09ba8c8f27412fb3166b6d5d5cb985870424f856 /tests/rest/client/v2_alpha/test_account.py | |
parent | Process EDUs in parallel with PDUs. (#6697) (diff) | |
download | synapse-28c98e51ffa166bd717646b0b34228e59f253485.tar.xz |
Add `local_current_membership` table (#6655)
Currently we rely on `current_state_events` to figure out what rooms a user was in and their last membership event in there. However, if the server leaves the room then the table may be cleaned up and that information is lost. So lets add a table that separately holds that information.
Diffstat (limited to 'tests/rest/client/v2_alpha/test_account.py')
-rw-r--r-- | tests/rest/client/v2_alpha/test_account.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/rest/client/v2_alpha/test_account.py b/tests/rest/client/v2_alpha/test_account.py index 0f51895b81..c3facc00eb 100644 --- a/tests/rest/client/v2_alpha/test_account.py +++ b/tests/rest/client/v2_alpha/test_account.py @@ -285,7 +285,9 @@ class DeactivateTestCase(unittest.HomeserverTestCase): ) # Make sure the invite is here. - pending_invites = self.get_success(store.get_invited_rooms_for_user(invitee_id)) + pending_invites = self.get_success( + store.get_invited_rooms_for_local_user(invitee_id) + ) self.assertEqual(len(pending_invites), 1, pending_invites) self.assertEqual(pending_invites[0].room_id, room_id, pending_invites) @@ -293,12 +295,16 @@ class DeactivateTestCase(unittest.HomeserverTestCase): self.deactivate(invitee_id, invitee_tok) # Check that the invite isn't there anymore. - pending_invites = self.get_success(store.get_invited_rooms_for_user(invitee_id)) + pending_invites = self.get_success( + store.get_invited_rooms_for_local_user(invitee_id) + ) self.assertEqual(len(pending_invites), 0, pending_invites) # Check that the membership of @invitee:test in the room is now "leave". memberships = self.get_success( - store.get_rooms_for_user_where_membership_is(invitee_id, [Membership.LEAVE]) + store.get_rooms_for_local_user_where_membership_is( + invitee_id, [Membership.LEAVE] + ) ) self.assertEqual(len(memberships), 1, memberships) self.assertEqual(memberships[0].room_id, room_id, memberships) |