diff --git a/tests/functional/relation_quoting/test_relation_quoting.py b/tests/functional/relation_quoting/test_relation_quoting.py index 5dfa40bbb87..55f492cc080 100644 --- a/tests/functional/relation_quoting/test_relation_quoting.py +++ b/tests/functional/relation_quoting/test_relation_quoting.py @@ -12,7 +12,7 @@ """ -class TestSourceQuotingLegacy: +class TestSourceQuotingGlobalConfigs: @pytest.fixture(scope="class") def project_config_update(self): # Postgres quoting configs are True by default -- turn them all to False to show they are not respected during source rendering @@ -20,7 +20,7 @@ def project_config_update(self): "quoting": { "database": False, "schema": False, - "database": False, + "identifier": False, }, } @@ -36,3 +36,29 @@ def test_sources_ignore_global_quoting_configs(self, project): generated_sql = read_file("target", "compiled", "test", "models", "model.sql") assert generated_sql == 'select * from "source_database"."source_schema"."customers"' + + +class TestModelQuoting: + @pytest.fixture(scope="class") + def project_config_update(self): + # Postgres quoting configs are True by default -- turn them all to False to show they are respected during model rendering + return { + "quoting": { + "database": False, + "schema": False, + "identifier": False, + }, + } + + @pytest.fixture(scope="class") + def models(self): + return { + "model.sql": "select 1 as id", + "model_downstream.sql": "select * from {{ ref('model') }}", + } + + def test_models_respect_global_quoting_configs(self, project): + run_dbt(["compile"]) + + generated_sql = read_file("target", "compiled", "test", "models", "model_downstream.sql") + assert generated_sql == f"select * from dbt.{project.test_schema}.model"