Skip to content

Commit f1b5821

Browse files
pt-tslnossila
authored andcommitted
fix: tests and PR suggestions
1 parent 3e971dd commit f1b5821

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

baseapp-chats/baseapp_chats/graphql/mutations.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ def mutate_and_get_payload(cls, root, info, profile_id, participants, is_group,
137137
image=image,
138138
)
139139

140-
ChatRoomParticipant.objects.bulk_create(
140+
created_participants = ChatRoomParticipant.objects.bulk_create(
141141
[
142142
ChatRoomParticipant(profile=participant, room=room, accepted_at=timezone.now())
143143
for participant in participants
144144
]
145145
)
146146

147-
room.participants_count = len(participants)
147+
room.participants_count = len(created_participants)
148148
room.save()
149149

150150
return ChatRoomCreate(

baseapp-chats/baseapp_chats/tests/test_graphql_subscriptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ async def test_user_recieves_message_count_update(django_user_client, graphql_ws
181181

182182
resp = await client.receive(assert_id=sub_id, assert_type="next")
183183

184-
assert resp["data"]["chatRoomOnMessagesCountUpdate"]["profile"]["unreadMessagesCount"] == 1
185-
186184
# Disconnect and wait the application to finish gracefully.
187185
await client.finalize()
186+
187+
assert resp["data"]["chatRoomOnMessagesCountUpdate"]["profile"]["unreadMessagesCount"] == 1

0 commit comments

Comments
 (0)