Don't update trade fees for dry-run orders

This commit is contained in:
Matthias
2021-01-17 20:31:27 +01:00
parent 389db2fe7d
commit a8bae3a381
2 changed files with 17 additions and 0 deletions

View File

@@ -4368,6 +4368,19 @@ def test_update_closed_trades_without_assigned_fees(mocker, default_conf, fee):
freqtrade.update_closed_trades_without_assigned_fees()
# Does nothing for dry-run
trades = Trade.get_trades().all()
assert len(trades) == MOCK_TRADE_COUNT
for trade in trades:
assert trade.fee_open_cost is None
assert trade.fee_open_currency is None
assert trade.fee_close_cost is None
assert trade.fee_close_currency is None
freqtrade.config['dry_run'] = False
freqtrade.update_closed_trades_without_assigned_fees()
trades = Trade.get_trades().all()
assert len(trades) == MOCK_TRADE_COUNT