diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-12-03 14:09:34 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-12-03 14:09:34 +0000 |
| commit | 851a14aa1a0e7a734a6f810f0e6e5c39d8e63b1b (patch) | |
| tree | 8c2cc85fc64eb8765a588668f567ad785993ab73 /test/sql | |
| parent | 3c1aa033e69e77a010cd8786fdc7f7d1239447b0 (diff) | |
| download | sqlalchemy-851a14aa1a0e7a734a6f810f0e6e5c39d8e63b1b.tar.gz | |
- Using the same ForeignKey object repeatedly
raises an error instead of silently failing
later. [ticket:1238]
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/constraints.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/sql/constraints.py b/test/sql/constraints.py index b7208532c..ab08c6d98 100644 --- a/test/sql/constraints.py +++ b/test/sql/constraints.py @@ -29,7 +29,16 @@ class ConstraintTest(TestBase, AssertsExecutionResults): ForeignKeyConstraint(['emp_id', 'emp_soc'], ['employees.id', 'employees.soc']) ) metadata.create_all() - + + def test_double_fk_usage_raises(self): + f = ForeignKey('b.id') + + self.assertRaises(exc.InvalidRequestError, Table, "a", metadata, + Column('x', Integer, f), + Column('y', Integer, f) + ) + + def test_circular_constraint(self): a = Table("a", metadata, Column('id', Integer, primary_key=True), |
