diff --git a/tests/functional/deprecations/fixtures.py b/tests/functional/deprecations/fixtures.py index d9ae97603db..85f45d78f47 100644 --- a/tests/functional/deprecations/fixtures.py +++ b/tests/functional/deprecations/fixtures.py @@ -30,6 +30,23 @@ email: something@example.com """ + +deprecated_model_exposure_yaml = """ +version: 2 + +models: + - name: model + deprecation_date: 1999-01-01 00:00:00.00+00:00 + +exposures: + - name: simple_exposure + type: dashboard + depends_on: + - ref('model') + owner: + email: something@example.com +""" + # deprecated test config fixtures data_tests_yaml = """ models: diff --git a/tests/functional/deprecations/test_deprecations.py b/tests/functional/deprecations/test_deprecations.py index 95779338d8a..2cb51935da4 100644 --- a/tests/functional/deprecations/test_deprecations.py +++ b/tests/functional/deprecations/test_deprecations.py @@ -7,6 +7,7 @@ from dbt_common.exceptions import EventCompilationError from tests.functional.deprecations.fixtures import ( bad_name_yaml, + deprecated_model_exposure_yaml, models_trivial__model_sql, ) @@ -99,6 +100,18 @@ def test_package_redirect_fail(self, project): assert expected_msg in exc_str +class TestDeprecatedModelExposure: + @pytest.fixture(scope="class") + def models(self): + return { + "model.sql": models_trivial__model_sql, + "exposure.yml": deprecated_model_exposure_yaml, + } + + def test_exposure_with_deprecated_model(self, project): + run_dbt(["parse"]) + + class TestExposureNameDeprecation: @pytest.fixture(scope="class") def models(self):