From b9f0a73e7467ad7d4a6ab0be93cbccd9532cfa6a Mon Sep 17 00:00:00 2001 From: Lennart <1247198+totalimmersion@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:41:16 +0200 Subject: [PATCH 1/2] [CHA-662] - Support for team based roles (#194) * added tests for team based roles * Update stream_chat/tests/test_client.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update stream_chat/tests/test_client.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- stream_chat/tests/test_client.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/stream_chat/tests/test_client.py b/stream_chat/tests/test_client.py index ca800a76..2df7dfd7 100644 --- a/stream_chat/tests/test_client.py +++ b/stream_chat/tests/test_client.py @@ -143,6 +143,18 @@ def test_update_user(self, client: StreamChat): assert "users" in response assert user["id"] in response["users"] + def test_update_user_with_team(self, client: StreamChat): + user = { + "id": str(uuid.uuid4()), + "team": "blue", + "teams_role": {"blue": "admin"}, + } + response = client.upsert_user(user) + assert "users" in response + assert user["id"] in response["users"] + assert response["users"][user["id"]]["team"] == "blue" + assert response["users"][user["id"]]["teams_role"]["blue"] == "admin" + def test_update_users(self, client: StreamChat): user = {"id": str(uuid.uuid4())} response = client.upsert_users([user]) @@ -161,6 +173,19 @@ def test_update_user_partial(self, client: StreamChat): assert user_id in response["users"] assert response["users"][user_id]["field"] == "updated" + def test_update_user_partial_with_team(self, client: StreamChat): + user_id = str(uuid.uuid4()) + client.upsert_user({"id": user_id, "name": "Test User"}) + + response = client.update_user_partial( + {"id": user_id, "set": {"team": "blue", "teams_role": {"blue": "admin"}}} + ) + + assert "users" in response + assert user_id in response["users"] + assert response["users"][user_id]["team"] == "blue" + assert response["users"][user_id]["teams_role"]["blue"] == "admin" + def test_delete_user(self, client: StreamChat, random_user: Dict): response = client.delete_user(random_user["id"]) assert "user" in response From b73ce04722f89112dc94daab52329c97489f623f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:45:00 +0200 Subject: [PATCH 2/2] chore(release): v4.24.0 (#196) Co-authored-by: github-actions --- CHANGELOG.md | 2 ++ stream_chat/__pkg__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 304fb6fa..ff7f7237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [4.24.0](https://github.com/GetStream/stream-chat-python/compare/v4.23.0...v4.24.0) (2025-04-07) + ## [4.23.0](https://github.com/GetStream/stream-chat-python/compare/v4.22.0...v4.23.0) (2025-03-11) ## [4.22.0](https://github.com/GetStream/stream-chat-python/compare/v4.21.0...v4.22.0) (2025-02-18) diff --git a/stream_chat/__pkg__.py b/stream_chat/__pkg__.py index c9eb8171..9576b27e 100644 --- a/stream_chat/__pkg__.py +++ b/stream_chat/__pkg__.py @@ -1,6 +1,6 @@ __author__ = "Tommaso Barbugli" __copyright__ = "Copyright 2019-2022, Stream.io, Inc" -__version__ = "4.23.0" +__version__ = "4.24.0" __maintainer__ = "Tommaso Barbugli" __email__ = "support@getstream.io" __status__ = "Production"