From 1d243806f441b596251cd15042a7a922c2d326dc 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 2367d8610..0ed012fd0 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)