summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-04-11 09:29:00 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-04-11 12:16:23 -0400
commit9d5e117f6fcc38d8773bc943c615888dc8a3a819 (patch)
treec81ed463fb3860e6e83eb765cda56f321153030c /test/engine
parent5abeee69e34d45796cdff0770f58f9104da74701 (diff)
downloadsqlalchemy-9d5e117f6fcc38d8773bc943c615888dc8a3a819.tar.gz
Correct join for FKs with schema in SQL Server
Fixed 1.2 regression caused by :ticket:`4060` where the query used to reflect SQL Server cross-schema foreign keys was limiting the criteria incorrectly. Additionally, added some rework of the inter-schema reflection tests so that MySQL, MSSQL can be included, breaking out some of the Postgresql-specific behaviors into separate requirements. Fixes: #4234 Change-Id: I20c8e70707075f1767b79127c2c27d4b313c6515
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_reflection.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index 724f36147..57c841dcf 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -1397,6 +1397,10 @@ class SchemaTest(fixtures.TestBase):
@testing.requires.schemas
@testing.requires.cross_schema_fk_reflection
def test_has_schema(self):
+ if not hasattr(testing.db.dialect, "has_schema"):
+ testing.config.skip_test(
+ "dialect %s doesn't have a has_schema method" %
+ testing.db.dialect.name)
eq_(testing.db.dialect.has_schema(testing.db,
testing.config.test_schema), True)
eq_(testing.db.dialect.has_schema(testing.db,
@@ -1404,6 +1408,7 @@ class SchemaTest(fixtures.TestBase):
@testing.requires.schemas
@testing.requires.cross_schema_fk_reflection
+ @testing.requires.implicit_default_schema
@testing.provide_metadata
def test_blank_schema_arg(self):
metadata = self.metadata
@@ -1411,11 +1416,13 @@ class SchemaTest(fixtures.TestBase):
Table('some_table', metadata,
Column('id', Integer, primary_key=True),
Column('sid', Integer, sa.ForeignKey('some_other_table.id')),
- schema=testing.config.test_schema
+ schema=testing.config.test_schema,
+ test_needs_fk=True
)
Table('some_other_table', metadata,
Column('id', Integer, primary_key=True),
- schema=None
+ schema=None,
+ test_needs_fk=True
)
metadata.create_all()
with testing.db.connect() as conn:
@@ -1536,6 +1543,7 @@ class SchemaTest(fixtures.TestBase):
@testing.requires.schemas
@testing.requires.cross_schema_fk_reflection
+ @testing.requires.implicit_default_schema
@testing.provide_metadata
def test_reflect_all_schemas_default_overlap(self):
t1 = Table('t', self.metadata,