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)