Skip to content

Commit

Permalink
fix: merge branch 'feature/chat-15-pinning-archiving-member-custom-da…
Browse files Browse the repository at this point in the history
…ta' of github.com:GetStream/stream-chat-python into feature/chat-15-pinning-archiving-member-custom-data
  • Loading branch information
totalimmersion committed Dec 6, 2024
2 parents a184fe9 + e4a2c88 commit 92aebe3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions stream_chat/tests/async_chat/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,19 +437,19 @@ async def test_archive_channel(
assert len(response["channels"]) == 1
assert response["channels"][0]["channel"]["cid"] == channel.cid

async def test_update_member_partial(self, channel: Channel, random_users: List[Dict]):
async def test_update_member_partial(
self, channel: Channel, random_users: List[Dict]
):
user_id = random_users[0]["id"]
await channel.add_members([user_id])

# Test setting a custom field
response = await channel.update_member_partial(user_id, to_set={"hat": "blue"})
response = await channel.update_member_partial(user_id, set={"hat": "blue"})
assert response["channel_member"]["hat"] == "blue"

# Test setting a new field while unsetting the previous one
response = await channel.update_member_partial(
user_id,
to_set={"color": "red"},
to_unset=["hat"]
user_id, set={"color": "red"}, unset=["hat"]
)
assert response["channel_member"]["color"] == "red"
assert "hat" not in response["channel_member"]
6 changes: 2 additions & 4 deletions stream_chat/tests/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,12 @@ def test_update_member_partial(self, channel: Channel, random_users: List[Dict])
channel.add_members([user_id])

# Test setting a custom field
response = channel.update_member_partial(user_id, to_unset={"hat": "blue"})
response = channel.update_member_partial(user_id, set={"hat": "blue"})
assert response["channel_member"]["hat"] == "blue"

# Test setting a new field while unsetting the previous one
response = channel.update_member_partial(
user_id,
to_unset={"color": "red"},
unset=["hat"]
user_id, set={"color": "red"}, unset=["hat"]
)
assert response["channel_member"]["color"] == "red"
assert "hat" not in response["channel_member"]

0 comments on commit 92aebe3

Please sign in to comment.