diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-13 11:20:53 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-13 19:31:30 -0400 |
commit | 6b0e12fd6f50a75750daf71ddff4bf32565fdf86 (patch) | |
tree | fb196a35d800c410db10b48152afda3de569bf66 /lib/sqlalchemy/testing | |
parent | 4a886e519ff227039a9d603aa4727c6f828f93ff (diff) | |
download | sqlalchemy-6b0e12fd6f50a75750daf71ddff4bf32565fdf86.tar.gz |
Normalize Oracle reflected FK constraint name
Oracle reflection now "normalizes" the name given to a foreign key
constraint, that is, returns it as all lower case for a case
insensitive name. This was already the behavior for indexes
and primary key constraints as well as all table and column names.
This will allow Alembic autogenerate scripts to compare and render
foreign key constraint names correctly when initially specified
as case insensitive.
Change-Id: Ibb34ec6ce7cb244d1c4ae9d44ce2d37d37227e69
Fixes: #3276
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_reflection.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index ed6a33b6d..572cc4a0a 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -70,7 +70,8 @@ class ComponentReflectionTest(fixtures.TablesTest): Column('test2', sa.Float(5), nullable=False), Column('parent_user_id', sa.Integer, sa.ForeignKey('%susers.user_id' % - schema_prefix)), + schema_prefix, + name='user_id_fk')), schema=schema, test_needs_fk=True, ) @@ -444,7 +445,7 @@ class ComponentReflectionTest(fixtures.TablesTest): fkey1 = users_fkeys[0] with testing.requires.named_constraints.fail_if(): - self.assert_(fkey1['name'] is not None) + eq_(fkey1['name'], "user_id_fk") eq_(fkey1['referred_schema'], expected_schema) eq_(fkey1['referred_table'], users.name) @@ -457,7 +458,7 @@ class ComponentReflectionTest(fixtures.TablesTest): schema=schema) fkey1 = addr_fkeys[0] - with testing.requires.named_constraints.fail_if(): + with testing.requires.implicitly_named_constraints.fail_if(): self.assert_(fkey1['name'] is not None) eq_(fkey1['referred_schema'], expected_schema) |