Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add test for forgetting rooms on leave
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Quah <[email protected]>
  • Loading branch information
Sean Quah committed Mar 8, 2023
1 parent 3d155cd commit 4b3de73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/handlers/test_room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,17 @@ def test_leave_and_forget(self) -> None:
self.get_success(self.store.is_locally_forgotten_room(self.room_id))
)

@override_config({"forget_rooms_on_leave": True})
def test_leave_and_auto_forget(self) -> None:
"""Tests the `forget_rooms_on_leave` config option."""
self.helper.join(self.room_id, user=self.bob, tok=self.bob_token)

# alice is not the last room member that leaves and forgets the room
self.helper.leave(self.room_id, user=self.alice, tok=self.alice_token)
self.assertTrue(
self.get_success(self.store.did_forget(self.alice, self.room_id))
)

def test_leave_and_forget_last_user(self) -> None:
"""Tests that forget a room is successfully when the last user has left the room."""

Expand Down

0 comments on commit 4b3de73

Please sign in to comment.