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

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Velten committed May 12, 2023
1 parent b955088 commit 283ac1d
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tests/rest/admin/test_server_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from synapse.storage.roommember import RoomsForUser
from synapse.types import JsonDict
from synapse.util import Clock
from synapse.util.stringutils import random_string

from tests import unittest
from tests.unittest import override_config
Expand Down Expand Up @@ -413,11 +414,25 @@ def test_send_server_notice_delete_room(self) -> None:
self.assertEqual(messages[0]["content"]["body"], "test msg one")
self.assertEqual(messages[0]["sender"], "@notices:test")

delete_id = random_string(16)

# shut down and purge room
self.get_success(
self.room_shutdown_handler.shutdown_room(first_room_id, self.admin_user)
)
self.get_success(self.pagination_handler.purge_room(first_room_id))
self.room_shutdown_handler.shutdown_room(
first_room_id,
delete_id,
{
"requester_user_id": self.admin_user,
"new_room_user_id": None,
"new_room_name": None,
"message": None,
"block": False,
"purge": True,
"force_purge": False,
},
)
)
self.get_success(self.pagination_handler.purge_room(first_room_id, "delete_id"))

# user is not member anymore
self._check_invite_and_join_status(self.other_user, 0, 0)
Expand Down

0 comments on commit 283ac1d

Please sign in to comment.