From 18dd9cf803c951b8209ee2f86995711cbac2f291 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 23 Dec 2023 09:47:33 +0100 Subject: [PATCH] Use a trade for test that actually has an open stop order --- tests/rpc/test_rpc_apiserver.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 17b0399d9..9957ebdb0 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -728,7 +728,6 @@ def test_api_delete_trade(botclient, mocker, fee, markets, is_short): ftbot.strategy.order_types['stoploss_on_exchange'] = True trades = Trade.session.scalars(select(Trade)).all() - trades[1].stoploss_order_id = '1234' Trade.commit() assert len(trades) > 2 @@ -745,9 +744,9 @@ def test_api_delete_trade(botclient, mocker, fee, markets, is_short): assert cancel_mock.call_count == 0 assert len(trades) - 1 == len(Trade.session.scalars(select(Trade)).all()) - rc = client_delete(client, f"{BASE_URI}/trades/2") + rc = client_delete(client, f"{BASE_URI}/trades/5") assert_response(rc) - assert rc.json()['result_msg'] == 'Deleted trade 2. Closed 1 open orders.' + assert rc.json()['result_msg'] == 'Deleted trade 5. Closed 1 open orders.' assert len(trades) - 2 == len(Trade.session.scalars(select(Trade)).all()) assert stoploss_mock.call_count == 1