diff --git a/tests/strategy/strats/legacy_strategy.py b/tests/strategy/strats/legacy_strategy.py index 89ce3f8cb..9cbce0ad5 100644 --- a/tests/strategy/strats/legacy_strategy.py +++ b/tests/strategy/strats/legacy_strategy.py @@ -31,6 +31,7 @@ class TestStrategyLegacy(IStrategy): stoploss = -0.10 # Optimal ticker interval for the strategy + # Keep the legacy value here to test compatibility ticker_interval = '5m' def populate_indicators(self, dataframe: DataFrame) -> DataFrame: diff --git a/tests/strategy/test_strategy.py b/tests/strategy/test_strategy.py index 1bb45f28c..f2cf11712 100644 --- a/tests/strategy/test_strategy.py +++ b/tests/strategy/test_strategy.py @@ -370,6 +370,8 @@ def test_call_deprecated_function(result, monkeypatch, default_conf): assert strategy._buy_fun_len == 2 assert strategy._sell_fun_len == 2 assert strategy.INTERFACE_VERSION == 1 + assert strategy.timeframe == '5m' + assert strategy.ticker_interval == '5m' indicator_df = strategy.advise_indicators(result, metadata=metadata) assert isinstance(indicator_df, DataFrame) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 1ed97f728..9602f6389 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -1137,3 +1137,15 @@ def test_process_deprecated_setting(mocker, default_conf, caplog): 'sectionB', 'deprecated_setting') assert not log_has_re('DEPRECATED', caplog) assert default_conf['sectionA']['new_setting'] == 'valA' + + +def test_process_deprecated_ticker_interval(mocker, default_conf, caplog): + message = "DEPRECATED: Please use 'timeframe' instead of 'ticker_interval." + process_temporary_deprecated_settings(default_conf) + assert not log_has(message, caplog) + + del default_conf['timeframe'] + default_conf['ticker_interval'] = '15m' + process_temporary_deprecated_settings(default_conf) + assert log_has(message, caplog) + assert default_conf['ticker_interval'] == '15m'