diff options
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 8da18108f..4897c4a7e 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -582,6 +582,29 @@ class ReflectionTest(fixtures.TestBase): ['test_schema_2.some_other_table', 'test_schema.some_table'])) @testing.provide_metadata + def test_cross_schema_reflection_metadata_uses_schema(self): + # test [ticket:3716] + + metadata = self.metadata + + Table('some_table', metadata, + Column('id', Integer, primary_key=True), + Column('sid', Integer, ForeignKey('some_other_table.id')), + schema='test_schema' + ) + Table('some_other_table', metadata, + Column('id', Integer, primary_key=True), + schema=None + ) + metadata.create_all() + with testing.db.connect() as conn: + meta2 = MetaData(conn, schema="test_schema") + meta2.reflect() + + eq_(set(meta2.tables), set( + ['some_other_table', 'test_schema.some_table'])) + + @testing.provide_metadata def test_uppercase_lowercase_table(self): metadata = self.metadata |