summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/requirements.py6
-rw-r--r--lib/sqlalchemy/testing/suite/test_reflection.py15
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index 1990eb9d5..b509c94d6 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -409,7 +409,11 @@ class SuiteRequirements(Requirements):
return exclusions.open()
@property
- def foreign_key_constraint_option_reflection(self):
+ def foreign_key_constraint_option_reflection_ondelete(self):
+ return exclusions.closed()
+
+ @property
+ def foreign_key_constraint_option_reflection_onupdate(self):
return exclusions.closed()
@property
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py
index 0c391fad0..1275cac03 100644
--- a/lib/sqlalchemy/testing/suite/test_reflection.py
+++ b/lib/sqlalchemy/testing/suite/test_reflection.py
@@ -540,9 +540,16 @@ class ComponentReflectionTest(fixtures.TablesTest):
def test_get_foreign_keys_with_schema(self):
self._test_get_foreign_keys(schema=testing.config.test_schema)
- @testing.requires.foreign_key_constraint_option_reflection
+ @testing.requires.foreign_key_constraint_option_reflection_ondelete
+ def test_get_foreign_key_options_ondelete(self):
+ self._test_get_foreign_key_options(ondelete="CASCADE")
+
+ @testing.requires.foreign_key_constraint_option_reflection_onupdate
+ def test_get_foreign_key_options_onupdate(self):
+ self._test_get_foreign_key_options(onupdate="SET NULL")
+
@testing.provide_metadata
- def test_get_foreign_key_options(self):
+ def _test_get_foreign_key_options(self, **options):
meta = self.metadata
Table(
@@ -564,7 +571,7 @@ class ComponentReflectionTest(fixtures.TablesTest):
sa.ForeignKeyConstraint(
['tid'], ['table.id'],
name='myfk',
- onupdate="SET NULL", ondelete="CASCADE"),
+ **options),
test_needs_fk=True)
meta.create_all()
@@ -589,7 +596,7 @@ class ComponentReflectionTest(fixtures.TablesTest):
(k, opts[k])
for k in opts if opts[k]
),
- {'onupdate': 'SET NULL', 'ondelete': 'CASCADE'}
+ options
)
def _assert_insp_indexes(self, indexes, expected_indexes):