From 2bb4891e4e36269836f2eb6a48b656477604cd1f 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 a01e95c5d..f26ee6136 100644 --- a/tests/utils/trade.py +++ b/tests/utils/trade.py @@ -116,7 +116,9 @@ def cancel_order(self, robot_index=1, cancel_status=None): 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)