From 66afc233dbc6396d615df3eac9f0aa491ee3c0c6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 9 Mar 2022 06:40:12 +0100 Subject: [PATCH] Use Deprecated method for order_Time_in_force --- freqtrade/configuration/config_validation.py | 7 +++++-- tests/test_configuration.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/configuration/config_validation.py b/freqtrade/configuration/config_validation.py index 48a460ccb..267509b43 100644 --- a/freqtrade/configuration/config_validation.py +++ b/freqtrade/configuration/config_validation.py @@ -230,8 +230,11 @@ def _validate_time_in_force(conf: Dict[str, Any]) -> None: "DEPRECATED: Using 'buy' and 'sell' for time_in_force is deprecated." "Please migrate your time_in_force settings to use 'entry' and 'exit'." ) - time_in_force['entry'] = time_in_force.pop('buy') - time_in_force['exit'] = time_in_force.pop('sell') + process_deprecated_setting( + conf, 'order_time_in_force', 'buy', 'order_time_in_force', 'entry') + + process_deprecated_setting( + conf, 'order_time_in_force', 'sell', 'order_time_in_force', 'exit') def _validate_order_types(conf: Dict[str, Any]) -> None: diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 786fdbb73..2c1141940 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -997,6 +997,7 @@ def test_validate_order_types(default_conf, caplog) -> None: match=r"Please migrate your order_types settings to use the new wording\."): validate_config_consistency(conf) + def test_load_config_test_comments() -> None: """ Load config with comments