diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index f8db7be..eaaf74d 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -648,29 +648,32 @@ def models(self): @pytest.fixture(scope="class") def expected_sql(self): return """ - if object_id is not null begin drop view end - if object_id is not null begin drop table end - exec(\'create view as select \'\'blue\'\' as "from",1 as id,\'\'2019-01-01\'\' as date_day;\'); - create table ([id] int not null,[from] varchar(100)not null,[date_day] varchar(100)) - with(distribution = round_robin,heap) - insert into ([id],[from],[date_day]) - select [id],[from],[date_day] from - if object_id is not null begin drop view end + exec(\'create view as select \'\'blue\'\' as "from",1 as id,\'\'2019-01-01\'\' as date_day;\'); create table ([id] int not null,[from] varchar(100)not null,[date_day] varchar(100))with(distribution = round_robin,heap)insert into ([id],[from],[date_day])select [id],[from],[date_day] from """ - class TestTableConstraintsRuntimeDdlEnforcementSynapse(BaseConstraintsRuntimeDdlEnforcement): - pass - + @pytest.fixture(scope="class") + def expected_sql(self): + return """ + exec('create view as -- depends_on: select ''blue'' as color,1 as id,''2019-01-01'' as date_day;'); create table ([id] int not null,[color] varchar(100),[date_day] varchar(100))with(distribution = round_robin,heap)insert into ([id],[color],[date_day])select [id],[color],[date_day] from + """ class TestIncrementalConstraintsRuntimeDdlEnforcementSynapse( BaseIncrementalConstraintsRuntimeDdlEnforcement ): - pass + @pytest.fixture(scope="class") + def expected_sql(self): + return """ + exec('create view as -- depends_on: select ''blue'' as color,1 as id,''2019-01-01'' as date_day;'); create table ([id] int not null,[color] varchar(100),[date_day] varchar(100))with(distribution = round_robin,heap)insert into ([id],[color],[date_day])select [id],[color],[date_day] from + """ class TestModelConstraintsRuntimeEnforcementSynapse(BaseModelConstraintsRuntimeEnforcement): - pass + @pytest.fixture(scope="class") + def expected_sql(self): + return """ + exec('create view as -- depends_on: select ''blue'' as color,1 as id,''2019-01-01'' as date_day;'); create table ([id] int not null,[color] varchar(100),[date_day] varchar(100))with(distribution = round_robin,heap)insert into ([id],[color],[date_day])select [id],[color],[date_day] from + """ class TestTableConstraintsColumnsEqualSynapse(BaseTableConstraintsColumnsEqual):