Update failing test

This commit is contained in:
Matthias
2022-02-20 14:27:26 +01:00
parent db540dc990
commit dc7bcf5dda
4 changed files with 8 additions and 4 deletions

View File

@@ -1738,7 +1738,6 @@ def test_update_trade_state_withorderdict(default_conf_usdt, trades_for_order, l
assert not log_has_re(log_text, caplog)
def test_update_trade_state_exception(mocker, default_conf_usdt,
limit_buy_order_usdt, caplog) -> None:
freqtrade = get_patched_freqtradebot(mocker, default_conf_usdt)

View File

@@ -4,6 +4,7 @@ import pytest
from freqtrade.enums import SellType
from freqtrade.persistence import Trade
from freqtrade.persistence.models import Order
from freqtrade.rpc.rpc import RPC
from freqtrade.strategy.interface import SellCheckTuple
from tests.conftest import get_patched_freqtradebot, patch_get_signal
@@ -94,7 +95,11 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee,
trades = Trade.query.all()
# Make sure stoploss-order is open and trade is bought (since we mock update_trade_state)
for trade in trades:
trade.stoploss_order_id = 3
stoploss_order_closed['id'] = '3'
oobj = Order.parse_from_ccxt_object(stoploss_order_closed, trade.pair, 'stoploss')
trade.orders.append(oobj)
trade.stoploss_order_id = '3'
trade.open_order_id = None
n = freqtrade.exit_positions(trades)