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

Fix a bug in unit test test_block_room_and_not_purge #11226

Merged
merged 3 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11226.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug in unit test `test_block_room_and_not_purge`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be 11226.misc because it's not a user-visible bug (rather, a mistake and hole in our test coverage).

Otherwise I'm happy with this. I'll open a separate PR to make the api return 400 if you ask for both block and purge to be False.

4 changes: 2 additions & 2 deletions tests/rest/admin/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_block_room_and_not_purge(self):
# Assert one user in room
self._is_member(room_id=self.room_id, user_id=self.other_user)

body = json.dumps({"block": False, "purge": False})
body = json.dumps({"block": True, "purge": False})

channel = self.make_request(
"DELETE",
Expand All @@ -278,7 +278,7 @@ def test_block_room_and_not_purge(self):

with self.assertRaises(AssertionError):
self._is_purged(self.room_id)
self._is_blocked(self.room_id, expect=False)
self._is_blocked(self.room_id, expect=True)
self._has_no_members(self.room_id)

def test_shutdown_room_consent(self):
Expand Down