diff options
author | Erik Johnston <erik@matrix.org> | 2020-10-23 10:41:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-23 10:41:32 +0100 |
commit | db9ef792f03aafa9f15d796a4004b0e0e551646d (patch) | |
tree | d7672d14f2c4a9f7ec85207c590385f31bf88acb /tests/push/test_email.py | |
parent | Merge tag 'v1.22.0rc1' into develop (diff) | |
download | synapse-db9ef792f03aafa9f15d796a4004b0e0e551646d.tar.xz |
Fix email notifications for invites without local state. (#8627)
This can happen if e.g. the room invited into is no longer on the server (or if all users left the room).
Diffstat (limited to '')
-rw-r--r-- | tests/push/test_email.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/push/test_email.py b/tests/push/test_email.py index 55545d9341..d9993e6245 100644 --- a/tests/push/test_email.py +++ b/tests/push/test_email.py @@ -131,6 +131,35 @@ class EmailPusherTests(HomeserverTestCase): # We should get emailed about that message self._check_for_mail() + def test_invite_sends_email(self): + # Create a room and invite the user to it + room = self.helper.create_room_as(self.others[0].id, tok=self.others[0].token) + self.helper.invite( + room=room, + src=self.others[0].id, + tok=self.others[0].token, + targ=self.user_id, + ) + + # We should get emailed about the invite + self._check_for_mail() + + def test_invite_to_empty_room_sends_email(self): + # Create a room and invite the user to it + room = self.helper.create_room_as(self.others[0].id, tok=self.others[0].token) + self.helper.invite( + room=room, + src=self.others[0].id, + tok=self.others[0].token, + targ=self.user_id, + ) + + # Then have the original user leave + self.helper.leave(room, self.others[0].id, tok=self.others[0].token) + + # We should get emailed about the invite + self._check_for_mail() + def test_multiple_members_email(self): # We want to test multiple notifications, so we pause processing of push # while we send messages. |