mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-17 05:11:15 +00:00
@@ -1094,7 +1094,7 @@ class RPC:
|
||||
trade = Trade.get_trades(trade_filter=[Trade.id == trade_id]).first()
|
||||
if not trade:
|
||||
logger.warning("delete trade: Invalid argument received")
|
||||
raise RPCException("invalid argument")
|
||||
raise RPCException(f"Trade with id '{trade_id}' not found.")
|
||||
|
||||
# Try cancelling regular order if that exists
|
||||
for open_order in trade.open_orders:
|
||||
|
||||
@@ -393,7 +393,7 @@ def test_rpc_delete_trade(mocker, default_conf, fee, markets, caplog, is_short):
|
||||
freqtradebot.strategy.order_types["stoploss_on_exchange"] = True
|
||||
create_mock_trades(fee, is_short)
|
||||
rpc = RPC(freqtradebot)
|
||||
with pytest.raises(RPCException, match="invalid argument"):
|
||||
with pytest.raises(RPCException, match="Trade with id '200' not found."):
|
||||
rpc._rpc_delete("200")
|
||||
|
||||
trades = Trade.session.scalars(select(Trade)).all()
|
||||
|
||||
Reference in New Issue
Block a user