diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py index 8725ad2c5..ef6c8b204 100644 --- a/tests/rpc/test_rpc.py +++ b/tests/rpc/test_rpc.py @@ -156,9 +156,25 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None: 'filled': 0.0, 'remaining': 91.07468123 }) - assert results[0] == response_unfilled + # Open order without remaining + trade = Trade.get_open_trades()[0] + # kucoin case (no remaining set). + trade.orders[0].remaining = None + Trade.commit() + + results = rpc._rpc_trade_status() + # Reuse above object, only remaining changed. + response_unfilled['orders'][0].update({ + 'remaining': None + }) + assert results[0] == response_unfilled + + trade = Trade.get_open_trades()[0] + trade.orders[0].remaining = trade.amount + Trade.commit() + # Fill open order ... freqtradebot.manage_open_orders() trades = Trade.get_open_trades()