Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
58 changes: 0 additions & 58 deletions stream_chat/tests/async_chat/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,64 +390,6 @@ async def test_update_message_partial(
assert response["message"]["text"] == "helloworld"
assert response["message"]["awesome"] is True

async def test_update_message_restricted_visibility(
self,
client: StreamChatAsync,
channel: Channel,
random_users: List[Dict],
):
amy = random_users[0]["id"]
paul = random_users[1]["id"]
user = random_users[2]["id"]

# Add users to channel
await channel.add_members([amy, paul])

# Send initial message
msg_id = str(uuid.uuid4())
response = await channel.send_message(
{"id": msg_id, "text": "hello world"}, user
)
assert response["message"]["text"] == "hello world"

# Update message with restricted visibility
response = await client.update_message(
{
"id": msg_id,
"text": "helloworld",
"restricted_visibility": [amy, paul],
"user": {"id": response["message"]["user"]["id"]},
}
)
assert response["message"]["text"] == "helloworld"
assert response["message"]["restricted_visibility"] == [amy, paul]

async def test_update_message_partial_restricted_visibility(
self,
client: StreamChatAsync,
channel: Channel,
random_users: List[Dict],
):
amy = random_users[0]["id"]
paul = random_users[1]["id"]
user = random_users[2]["id"]

# Add users to channel
await channel.add_members([amy, paul])

msg_id = str(uuid.uuid4())
response = await channel.send_message(
{"id": msg_id, "text": "hello world"}, user
)
assert response["message"]["text"] == "hello world"
response = await client.update_message_partial(
msg_id,
dict(set=dict(text="helloworld", restricted_visibility=[amy])),
user,
)

assert response["message"]["restricted_visibility"] == [amy]

async def test_delete_message(
self, client: StreamChatAsync, channel: Channel, random_user: Dict
):
Expand Down
52 changes: 0 additions & 52 deletions stream_chat/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,58 +476,6 @@ def test_update_message_partial(
assert response["message"]["text"] == "helloworld"
assert response["message"]["awesome"] is True

def test_update_message_restricted_visibility(
self,
client: StreamChat,
channel: Channel,
random_users: List[Dict],
):
amy = random_users[0]["id"]
paul = random_users[1]["id"]
user = random_users[2]["id"]
# Add users to channel
channel.add_members([amy, paul])

# Send initial message
msg_id = str(uuid.uuid4())
response = channel.send_message({"id": msg_id, "text": "hello world"}, user)
assert response["message"]["text"] == "hello world"

# Update message with restricted visibility
response = client.update_message(
{
"id": msg_id,
"text": "helloworld",
"restricted_visibility": [amy, paul],
"user": {"id": response["message"]["user"]["id"]},
}
)
assert response["message"]["text"] == "helloworld"
assert response["message"]["restricted_visibility"] == [amy, paul]

def test_update_message_partial_restricted_visibility(
self,
client: StreamChat,
channel: Channel,
random_users: List[Dict],
):
amy = random_users[0]["id"]
paul = random_users[1]["id"]
user = random_users[2]["id"]
# Add users to channel
channel.add_members([amy, paul])

msg_id = str(uuid.uuid4())
response = channel.send_message({"id": msg_id, "text": "hello world"}, user)
assert response["message"]["text"] == "hello world"
response = client.update_message_partial(
msg_id,
dict(set=dict(text="helloworld", restricted_visibility=[amy])),
user,
)

assert response["message"]["restricted_visibility"] == [amy]

def test_delete_message(self, client: StreamChat, channel, random_user: Dict):
msg_id = str(uuid.uuid4())
channel.send_message({"id": msg_id, "text": "helloworld"}, random_user["id"])
Expand Down