def test_diff_incompatible_inverse_transform_date(self):
        """
        Tests that `Diff` throws error when given series to `inverse_transform`
        which starts at a date not equal to the first data of the fitting data.
        """
        vals = np.random.rand(10, 5)
        series1 = TimeSeries.from_times_and_values(
            values=vals, times=pd.date_range(start="1/1/2018", freq="d", periods=10)
        )
        series2 = TimeSeries.from_times_and_values(
            values=vals, times=pd.date_range(start="1/2/2018", freq="d", periods=10)
        )
        for dropna in (False, True):
            diff = Diff(lags=1, dropna=dropna)
            diff.fit(series1)
            series2_diffed = series2.diff(n=1, periods=1, dropna=dropna)
            with pytest.raises(ValueError) as e:
                diff.inverse_transform(series2_diffed)
            expected_start = (
                series1.start_time()
                if (not dropna)
                else series1.start_time() + series1.freq
            )
            assert (
                f"Expected series to begin at time {expected_start}; "
                f"instead, it begins at time {series2_diffed.start_time()}."
            ) == str(e.value)

        Tests that `Diff` throws error when given series to `inverse_transform`
        which starts at a date not equal to the first data of the fitting data.
        
darts/tests/dataprocessing/transformers/test_diff.py