diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-09 17:54:11 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-09 17:54:11 -0400 |
| commit | 258d2a8315a1362c2995c75507f849c01526d3d5 (patch) | |
| tree | 1c941250e9d6f575f6453c90d89c072e70aad7d1 /test/engine/test_reflection.py | |
| parent | decf47a770b21da4bc66ad82d077fe069a1519f7 (diff) | |
| download | sqlalchemy-258d2a8315a1362c2995c75507f849c01526d3d5.tar.gz | |
- get_unique_constraints() pull request
- version (0.9 for now)
- changelog
- move the test into the test suite so that all dialects can take advantage of it
Diffstat (limited to 'test/engine/test_reflection.py')
| -rw-r--r-- | test/engine/test_reflection.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py index fd9411874..52cbc15e6 100644 --- a/test/engine/test_reflection.py +++ b/test/engine/test_reflection.py @@ -880,40 +880,6 @@ class ReflectionTest(fixtures.TestBase, ComparesTables): assert set([t2.c.name, t2.c.id]) == set(r2.columns) assert set([t2.c.name]) == set(r3.columns) - @testing.provide_metadata - def test_unique_constraints_reflection(self): - uniques = sorted( - [ - {'name': 'unique_a_b_c', 'column_names': ['a', 'b', 'c']}, - {'name': 'unique_a_c', 'column_names': ['a', 'c']}, - {'name': 'unique_b_c', 'column_names': ['b', 'c']}, - ], - key=operator.itemgetter('name') - ) - - try: - orig_meta = sa.MetaData(bind=testing.db) - table = Table( - 'testtbl', orig_meta, - Column('a', sa.String(20)), - Column('b', sa.String(30)), - Column('c', sa.Integer), - ) - for uc in uniques: - table.append_constraint( - sa.UniqueConstraint(*uc['column_names'], name=uc['name']) - ) - orig_meta.create_all() - - inspector = inspect(testing.db) - reflected = sorted( - inspector.get_unique_constraints('testtbl'), - key=operator.itemgetter('name') - ) - - assert uniques == reflected - finally: - testing.db.execute('drop table if exists testtbl;') @testing.requires.views @testing.provide_metadata |
