Improve test resiliance by properly setting Order object

This commit is contained in:
Matthias 2022-09-03 08:16:33 +02:00
parent b26126cb57
commit 966de19611
2 changed files with 4 additions and 0 deletions

View File

@ -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,

View File

@ -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,