Skip to content

Commit e333b58

Browse files
authored
[CHA-1630] Remove tests for updating restricted visibility (#215)
* [CHA-1630] Remove tests for updating restricted visibility Removed tests for updating messages with restricted visibility. * Remove tests for async client as well Removed tests for updating messages with restricted visibility.
1 parent b80c3d9 commit e333b58

File tree

2 files changed

+0
-110
lines changed

2 files changed

+0
-110
lines changed

stream_chat/tests/async_chat/test_client.py

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -390,64 +390,6 @@ async def test_update_message_partial(
390390
assert response["message"]["text"] == "helloworld"
391391
assert response["message"]["awesome"] is True
392392

393-
async def test_update_message_restricted_visibility(
394-
self,
395-
client: StreamChatAsync,
396-
channel: Channel,
397-
random_users: List[Dict],
398-
):
399-
amy = random_users[0]["id"]
400-
paul = random_users[1]["id"]
401-
user = random_users[2]["id"]
402-
403-
# Add users to channel
404-
await channel.add_members([amy, paul])
405-
406-
# Send initial message
407-
msg_id = str(uuid.uuid4())
408-
response = await channel.send_message(
409-
{"id": msg_id, "text": "hello world"}, user
410-
)
411-
assert response["message"]["text"] == "hello world"
412-
413-
# Update message with restricted visibility
414-
response = await client.update_message(
415-
{
416-
"id": msg_id,
417-
"text": "helloworld",
418-
"restricted_visibility": [amy, paul],
419-
"user": {"id": response["message"]["user"]["id"]},
420-
}
421-
)
422-
assert response["message"]["text"] == "helloworld"
423-
assert response["message"]["restricted_visibility"] == [amy, paul]
424-
425-
async def test_update_message_partial_restricted_visibility(
426-
self,
427-
client: StreamChatAsync,
428-
channel: Channel,
429-
random_users: List[Dict],
430-
):
431-
amy = random_users[0]["id"]
432-
paul = random_users[1]["id"]
433-
user = random_users[2]["id"]
434-
435-
# Add users to channel
436-
await channel.add_members([amy, paul])
437-
438-
msg_id = str(uuid.uuid4())
439-
response = await channel.send_message(
440-
{"id": msg_id, "text": "hello world"}, user
441-
)
442-
assert response["message"]["text"] == "hello world"
443-
response = await client.update_message_partial(
444-
msg_id,
445-
dict(set=dict(text="helloworld", restricted_visibility=[amy])),
446-
user,
447-
)
448-
449-
assert response["message"]["restricted_visibility"] == [amy]
450-
451393
async def test_delete_message(
452394
self, client: StreamChatAsync, channel: Channel, random_user: Dict
453395
):

stream_chat/tests/test_client.py

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -476,58 +476,6 @@ def test_update_message_partial(
476476
assert response["message"]["text"] == "helloworld"
477477
assert response["message"]["awesome"] is True
478478

479-
def test_update_message_restricted_visibility(
480-
self,
481-
client: StreamChat,
482-
channel: Channel,
483-
random_users: List[Dict],
484-
):
485-
amy = random_users[0]["id"]
486-
paul = random_users[1]["id"]
487-
user = random_users[2]["id"]
488-
# Add users to channel
489-
channel.add_members([amy, paul])
490-
491-
# Send initial message
492-
msg_id = str(uuid.uuid4())
493-
response = channel.send_message({"id": msg_id, "text": "hello world"}, user)
494-
assert response["message"]["text"] == "hello world"
495-
496-
# Update message with restricted visibility
497-
response = client.update_message(
498-
{
499-
"id": msg_id,
500-
"text": "helloworld",
501-
"restricted_visibility": [amy, paul],
502-
"user": {"id": response["message"]["user"]["id"]},
503-
}
504-
)
505-
assert response["message"]["text"] == "helloworld"
506-
assert response["message"]["restricted_visibility"] == [amy, paul]
507-
508-
def test_update_message_partial_restricted_visibility(
509-
self,
510-
client: StreamChat,
511-
channel: Channel,
512-
random_users: List[Dict],
513-
):
514-
amy = random_users[0]["id"]
515-
paul = random_users[1]["id"]
516-
user = random_users[2]["id"]
517-
# Add users to channel
518-
channel.add_members([amy, paul])
519-
520-
msg_id = str(uuid.uuid4())
521-
response = channel.send_message({"id": msg_id, "text": "hello world"}, user)
522-
assert response["message"]["text"] == "hello world"
523-
response = client.update_message_partial(
524-
msg_id,
525-
dict(set=dict(text="helloworld", restricted_visibility=[amy])),
526-
user,
527-
)
528-
529-
assert response["message"]["restricted_visibility"] == [amy]
530-
531479
def test_delete_message(self, client: StreamChat, channel, random_user: Dict):
532480
msg_id = str(uuid.uuid4())
533481
channel.send_message({"id": msg_id, "text": "helloworld"}, random_user["id"])

0 commit comments

Comments
 (0)