Fix some more tests

This commit is contained in:
Matthias
2023-12-22 17:35:02 +01:00
parent 13780d5963
commit b33a9059ab
2 changed files with 12 additions and 14 deletions

View File

@@ -280,19 +280,19 @@ def fix_old_dry_orders(engine):
# - current Trade is closed
# - current Order trade_id not equal to current Trade.id
# - current Order not stoploss
# TODO: is this still necessary ? how can this be done now ?
# stmt = update(Order).where(
# Order.ft_is_open.is_(True),
# tuple_(Order.ft_trade_id, Order.order_id).not_in(
# select(
# Trade.id, Trade.stoploss_order_id
# ).where(Trade.stoploss_order_id.is_not(None))
# ),
# Order.ft_order_side == 'stoploss',
# Order.order_id.like('dry%'),
stmt = update(Order).where(
Order.ft_is_open.is_(True),
tuple_(Order.ft_trade_id, Order.order_id).not_in(
select(
Trade.id, Trade.stoploss_order_id
).where(Trade.stoploss_order_id.is_not(None))
),
Order.ft_order_side == 'stoploss',
Order.order_id.like('dry%'),
).values(ft_is_open=False)
connection.execute(stmt)
# ).values(ft_is_open=False)
# connection.execute(stmt)
# Close dry-run orders for closed trades.
stmt = update(Order).where(

View File

@@ -1432,7 +1432,6 @@ def test_to_json(fee):
'stop_loss_abs': None,
'stop_loss_ratio': None,
'stop_loss_pct': None,
'stoploss_order_id': None,
'stoploss_last_update': None,
'stoploss_last_update_timestamp': None,
'initial_stop_loss_abs': None,
@@ -1500,7 +1499,6 @@ def test_to_json(fee):
'stop_loss_abs': None,
'stop_loss_pct': None,
'stop_loss_ratio': None,
'stoploss_order_id': None,
'stoploss_last_update': None,
'stoploss_last_update_timestamp': None,
'initial_stop_loss_abs': None,