Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Aug 26, 2024
1 parent febb2c8 commit 1ef38e2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_trade_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,16 @@ def test_created_order_expires(self):

self.assert_order_logs(data["id"])

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"],
f"😪 Hey {data['maker_nick']}, your order with ID {str(trade.order_id)} has expired without a taker.",
)

def test_public_order_expires(self):
"""
Tests the expiration of a public order
Expand Down Expand Up @@ -917,6 +927,16 @@ def test_taken_order_expires(self):

self.assert_order_logs(data["id"])

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"],
f"😪 Hey {data['maker_nick']}, your order with ID {str(trade.order_id)} has expired without a taker.",
)

def test_escrow_locked_expires(self):
"""
Tests the expiration of a public order
Expand Down Expand Up @@ -953,6 +973,16 @@ def test_escrow_locked_expires(self):

self.assert_order_logs(data["id"])

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"],
f"😪 Hey {data['maker_nick']}, your order with ID {str(trade.order_id)} has expired without a taker.",
)

def test_chat(self):
"""
Tests the chatting REST functionality
Expand Down

0 comments on commit 1ef38e2

Please sign in to comment.