def test_custom_fc_support_fit_on_residuals(self, model):
        """AutoETS does not support future covariates natively. Check that Darts' OLS trick is applied."""
        # test if we are indeed fitting the AutoETS on the residuals of the linear regression
        model.fit(series=self.series, future_covariates=self.ts_trend)

        # create the residuals from the linear regression
        fitted_values_linreg = model._linreg.model.predict(
            X=self.ts_trend.values(copy=False)
        )
        fitted_values_linreg_ts = TimeSeries.from_times_and_values(
            times=self.series.time_index, values=fitted_values_linreg
        )
        resids = self.series - fitted_values_linreg_ts

        # now make in-sample predictions with the AutoETS model
        in_sample_preds = model.model.predict_in_sample()["fitted"]
        ts_in_sample_preds = TimeSeries.from_times_and_values(
            times=self.series.time_index, values=in_sample_preds
        )

        # compare in-sample predictions to the residuals they have supposedly been fitted on
        current_mae = mae(resids, ts_in_sample_preds)
        assert current_mae < 9
AutoETS does not support future covariates natively. Check that Darts' OLS trick is applied.
darts/tests/models/forecasting/test_sf_models.py