From 966de1961180e39061277ffef00fdf78f1d86bdf Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 3 Sep 2022 08:16:33 +0200 Subject: [PATCH] Improve test resiliance by properly setting Order object --- tests/plugins/test_protections.py | 2 ++ tests/test_persistence.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/plugins/test_protections.py b/tests/plugins/test_protections.py index acfe124a8..820eced20 100644 --- a/tests/plugins/test_protections.py +++ b/tests/plugins/test_protections.py @@ -37,6 +37,7 @@ def generate_mock_trade(pair: str, fee: float, is_open: bool, trade.orders.append(Order( ft_order_side=trade.entry_side, order_id=f'{pair}-{trade.entry_side}-{trade.open_date}', + ft_is_open=False, ft_pair=pair, amount=trade.amount, filled=trade.amount, @@ -51,6 +52,7 @@ def generate_mock_trade(pair: str, fee: float, is_open: bool, trade.orders.append(Order( ft_order_side=trade.exit_side, order_id=f'{pair}-{trade.exit_side}-{trade.close_date}', + ft_is_open=False, ft_pair=pair, amount=trade.amount, filled=trade.amount, diff --git a/tests/test_persistence.py b/tests/test_persistence.py index f16c8b054..3ce8a0a2c 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -654,6 +654,7 @@ def test_trade_close(fee): trade.orders.append(Order( ft_order_side=trade.entry_side, order_id=f'{trade.pair}-{trade.entry_side}-{trade.open_date}', + ft_is_open=False, ft_pair=trade.pair, amount=trade.amount, filled=trade.amount, @@ -667,6 +668,7 @@ def test_trade_close(fee): trade.orders.append(Order( ft_order_side=trade.exit_side, order_id=f'{trade.pair}-{trade.exit_side}-{trade.open_date}', + ft_is_open=False, ft_pair=trade.pair, amount=trade.amount, filled=trade.amount,