Skip to content

Commit

Permalink
Fix chat
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Jun 26, 2024
1 parent 5862dae commit 326a2f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_trade_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,14 +997,14 @@ def test_chat(self):
self.assertEqual(trade.response.json()["messages"][0]["message"], message)
self.assertTrue(trade.response.json()["peer_connected"])

maker_headers = trade.get_robot_auth(trade.maker_index)
response = self.client.get(reverse("notifications"), **maker_headers)
taker_headers = trade.get_robot_auth(trade.taker_index)
response = self.client.get(reverse("notifications"), **taker_headers)
self.assertResponse(response)
notifications_data = list(response.json())
self.assertEqual(notifications_data[0]["order_id"], trade.order_id)
self.assertEqual(
notifications_data[0]["title"],
"✅ Hey your order wit",
f"💬 Hey {taker_nick}, a new chat message in-app was sent to you by {maker_nick} for order ID {trade.order_id}.",
)

# Post new message as taker without offset, so response should not have messages.
Expand All @@ -1013,14 +1013,14 @@ def test_chat(self):
self.assertEqual(trade.response.status_code, 200)
self.assertEqual(trade.response.json(), {}) # Nothing in the response

taker_headers = trade.get_robot_auth(trade.taker_index)
response = self.client.get(reverse("notifications"), **taker_headers)
maker_headers = trade.get_robot_auth(trade.maker_index)
response = self.client.get(reverse("notifications"), **maker_headers)
self.assertResponse(response)
notifications_data = list(response.json())
self.assertEqual(notifications_data[0]["order_id"], trade.order_id)
self.assertEqual(
notifications_data[0]["title"],
"✅ Hey your order wit",
f"💬 Hey {maker_nick}, a new chat message in-app was sent to you by {taker_nick} for order ID {trade.order_id}.",
)

# Get the two chatroom messages as maker
Expand Down

0 comments on commit 326a2f1

Please sign in to comment.