From: Mike Bayer Date: Fri, 3 Jun 2016 19:10:01 +0000 (-0400) Subject: - SQlite supports reflection of ON UPDATE / ON DELETE in SQLA 1.1 X-Git-Tag: rel_0_8_7~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59e28a08ccd6d3db5ba43ebe32d64b29d0e0068f;p=thirdparty%2Fsqlalchemy%2Falembic.git - SQlite supports reflection of ON UPDATE / ON DELETE in SQLA 1.1 - this reflection retains the original case --- diff --git a/alembic/testing/exclusions.py b/alembic/testing/exclusions.py index 85b8c7ce..31aead2e 100644 --- a/alembic/testing/exclusions.py +++ b/alembic/testing/exclusions.py @@ -431,7 +431,7 @@ def skip(db, reason=None): def only_on(dbs, reason=None): return only_if( - OrPredicate([SpecPredicate(db) for db in util.to_list(dbs)]) + OrPredicate([Predicate.as_predicate(db) for db in util.to_list(dbs)]) ) diff --git a/tests/requirements.py b/tests/requirements.py index 3703963b..491e6556 100644 --- a/tests/requirements.py +++ b/tests/requirements.py @@ -56,7 +56,10 @@ class DefaultRequirements(SuiteRequirements): @property def reflects_fk_options(self): - return exclusions.only_on(['postgresql', 'mysql']) + return exclusions.only_on([ + 'postgresql', 'mysql', + lambda config: util.sqla_110 and + exclusions.against(config, 'sqlite')]) @property def fk_initially(self): diff --git a/tests/test_autogen_fks.py b/tests/test_autogen_fks.py index 0a5b1de2..7b792bd5 100644 --- a/tests/test_autogen_fks.py +++ b/tests/test_autogen_fks.py @@ -542,7 +542,7 @@ class AutogenerateFKOptionsTest(AutogenFixtureTest, TestBase): def test_remove_ondelete(self): diffs = self._fk_opts_fixture( - {"ondelete": "cascade"}, {} + {"ondelete": "CASCADE"}, {} ) if self._expect_opts_supported(): @@ -595,7 +595,7 @@ class AutogenerateFKOptionsTest(AutogenFixtureTest, TestBase): def test_remove_onupdate(self): diffs = self._fk_opts_fixture( - {"onupdate": "cascade"}, {} + {"onupdate": "CASCADE"}, {} ) if self._expect_opts_supported(): @@ -713,8 +713,8 @@ class AutogenerateFKOptionsTest(AutogenFixtureTest, TestBase): def test_ondelete_onupdate_combo(self): diffs = self._fk_opts_fixture( - {"onupdate": "cascade", "ondelete": "set null"}, - {"onupdate": "restrict", "ondelete": "restrict"} + {"onupdate": "CASCADE", "ondelete": "SET NULL"}, + {"onupdate": "RESTRICT", "ondelete": "RESTRICT"} ) if self._expect_opts_supported(): @@ -731,8 +731,8 @@ class AutogenerateFKOptionsTest(AutogenFixtureTest, TestBase): diffs[1], "add_fk", "user", ["tid"], "table", ["id"], - onupdate="restrict", - ondelete="restrict" + onupdate="RESTRICT", + ondelete="RESTRICT" ) else: eq_(diffs, [])