Keep trade state in LocalTrade

This commit is contained in:
Matthias
2022-10-16 13:34:58 +02:00
parent 49426a924d
commit 0e8cf366f5
3 changed files with 22 additions and 17 deletions

View File

@@ -2406,6 +2406,8 @@ def test_Trade_object_idem():
'get_trading_volume',
)
EXCLUDES2 = ('trades', 'trades_open', 'bt_trades_open_pp', 'bt_open_open_trade_count',
'total_profit')
# Parent (LocalTrade) should have the same attributes
for item in trade:
@@ -2416,7 +2418,7 @@ def test_Trade_object_idem():
# Fails if only a column is added without corresponding parent field
for item in localtrade:
if (not item.startswith('__')
and item not in ('trades', 'trades_open', 'total_profit')
and item not in EXCLUDES2
and type(getattr(LocalTrade, item)) not in (property, FunctionType)):
assert item in trade