From ec0356f1b6db61677ce003fc3846bbae9569cc6b Mon Sep 17 00:00:00 2001 From: aftermath2 Date: Sun, 7 Jul 2024 10:40:57 -0300 Subject: [PATCH] Set cancel_status if it's not None --- tests/utils/trade.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/utils/trade.py b/tests/utils/trade.py index 2367d861..0ed012fd 100644 --- a/tests/utils/trade.py +++ b/tests/utils/trade.py @@ -116,7 +116,9 @@ class Trade: path = reverse("order") params = f"?order_id={self.order_id}" headers = self.get_robot_auth(robot_index) - body = {"action": "cancel", "cancel_status": cancel_status} + body = {"action": "cancel"} + if cancel_status is not None: + body.update({"cancel_status": cancel_status}) self.response = self.client.post(path + params, body, **headers) @patch("api.tasks.send_notification.delay", send_notification)