Skip to content

Commit cb36a31

Browse files
[MOD2-818] Add delete_reactions support for ban user (#229)
* feat: add delete_reactions support for ban user Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(test): simplify delete_reactions test to avoid async race Reaction deletion happens asynchronously via a background task, so we cannot assert on side-effects immediately. Verify the API accepts the parameter instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 02f694f commit cb36a31

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stream_chat/tests/test_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,17 @@ def test_shadow_ban(
333333
def test_ban_user(self, client: StreamChat, random_user, server_user: Dict):
334334
client.ban_user(random_user["id"], user_id=server_user["id"])
335335

336+
def test_ban_user_with_delete_reactions(
337+
self, client: StreamChat, random_user, server_user: Dict
338+
):
339+
# Reaction deletion happens asynchronously, so we only verify
340+
# the API accepts the delete_reactions parameter
341+
client.ban_user(
342+
random_user["id"],
343+
user_id=server_user["id"],
344+
delete_reactions=True,
345+
)
346+
336347
def test_unban_user(self, client: StreamChat, random_user, server_user: Dict):
337348
client.ban_user(random_user["id"], user_id=server_user["id"])
338349
client.unban_user(random_user["id"], user_id=server_user["id"])

0 commit comments

Comments
 (0)