diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-03-25 21:08:21 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2021-03-25 21:08:21 +0100 |
commit | 3fe8d618e3614edc8f9e4241e7521a984f2f21c6 (patch) | |
tree | 2f40cd4f8bb18ab51ec935f9563389928e92bdc8 /test/dialect/postgresql/test_reflection.py | |
parent | acd0122c2cb9ad0fe0cf92b306ea50dd51ec88b8 (diff) | |
download | sqlalchemy-3fe8d618e3614edc8f9e4241e7521a984f2f21c6.tar.gz |
Fixed reflection of identity columns in tables
with mixed case names in PostgreSQL.
Fixes: #6129
Change-Id: I50480cec03fcb44a668c9b0f9c72950803b771d9
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 6586a8308..855464916 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -1811,30 +1811,34 @@ class IdentityReflectionTest(fixtures.TablesTest): __backend__ = True __requires__ = ("identity_columns",) + _names = ("t1", "T2", "MiXeDCaSe!") + @classmethod def define_tables(cls, metadata): - Table( - "t1", - metadata, - Column( - "id1", - Integer, - Identity( - always=True, - start=2, - increment=3, - minvalue=-2, - maxvalue=42, - cycle=True, - cache=4, + for name in cls._names: + Table( + name, + metadata, + Column( + "id1", + Integer, + Identity( + always=True, + start=2, + increment=3, + minvalue=-2, + maxvalue=42, + cycle=True, + cache=4, + ), ), - ), - Column("id2", Integer, Identity()), - Column("id3", BigInteger, Identity()), - Column("id4", SmallInteger, Identity()), - ) + Column("id2", Integer, Identity()), + Column("id3", BigInteger, Identity()), + Column("id4", SmallInteger, Identity()), + ) - def test_reflect_identity(self, connection): + @testing.combinations(*_names, argnames="name") + def test_reflect_identity(self, connection, name): insp = inspect(connection) default = dict( always=False, @@ -1844,7 +1848,7 @@ class IdentityReflectionTest(fixtures.TablesTest): cycle=False, cache=1, ) - cols = insp.get_columns("t1") + cols = insp.get_columns(name) for col in cols: if col["name"] == "id1": is_true("identity" in col) |