mirror of
https://github.com/RoboSats/robosats.git
synced 2025-08-05 11:00:06 +00:00
Set cancel_status if it's not None
This commit is contained in:
@ -21,6 +21,7 @@ export interface SubmitActionProps {
|
|||||||
statement?: string;
|
statement?: string;
|
||||||
rating?: number;
|
rating?: number;
|
||||||
amount?: number;
|
amount?: number;
|
||||||
|
cancel_status?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TradeRobotSummary {
|
export interface TradeRobotSummary {
|
||||||
|
@ -1085,6 +1085,9 @@ class TradeTest(BaseAPITestCase):
|
|||||||
|
|
||||||
trade.cancel_order(trade.maker_index)
|
trade.cancel_order(trade.maker_index)
|
||||||
data = trade.response.json()
|
data = trade.response.json()
|
||||||
|
self.assertEqual(
|
||||||
|
data["bad_request"], "This order has been cancelled by the maker"
|
||||||
|
)
|
||||||
|
|
||||||
trade.get_order(trade.taker_index)
|
trade.get_order(trade.taker_index)
|
||||||
data = trade.response.json()
|
data = trade.response.json()
|
||||||
@ -1092,6 +1095,12 @@ class TradeTest(BaseAPITestCase):
|
|||||||
data["bad_request"], "This order has been cancelled by the maker"
|
data["bad_request"], "This order has been cancelled by the maker"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
trade.get_order(trade.third_index)
|
||||||
|
data = trade.response.json()
|
||||||
|
self.assertEqual(
|
||||||
|
data["bad_request"], "This order has been cancelled by the maker"
|
||||||
|
)
|
||||||
|
|
||||||
def test_cancel_order_cancel_status(self):
|
def test_cancel_order_cancel_status(self):
|
||||||
"""
|
"""
|
||||||
Tests the cancellation of a public order using cancel_status.
|
Tests the cancellation of a public order using cancel_status.
|
||||||
|
@ -118,7 +118,9 @@ class Trade:
|
|||||||
path = reverse("order")
|
path = reverse("order")
|
||||||
params = f"?order_id={self.order_id}"
|
params = f"?order_id={self.order_id}"
|
||||||
headers = self.get_robot_auth(robot_index)
|
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)
|
self.response = self.client.post(path + params, body, **headers)
|
||||||
|
|
||||||
@patch("api.tasks.send_notification.delay", send_notification)
|
@patch("api.tasks.send_notification.delay", send_notification)
|
||||||
|
Reference in New Issue
Block a user