summaryrefslogtreecommitdiff
path: root/tests/test_op.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_op.py')
-rw-r--r--tests/test_op.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_op.py b/tests/test_op.py
index c483c4a..8ae22a0 100644
--- a/tests/test_op.py
+++ b/tests/test_op.py
@@ -729,6 +729,21 @@ class OpTest(TestBase):
"FOREIGN KEY(foo) REFERENCES t1 (bar)"
)
+ def test_add_foreign_key_composite_self_referential(self):
+ """test #1215
+
+ the same column name is present on both sides.
+
+ """
+ context = op_fixture()
+ op.create_foreign_key(
+ "fk_test", "t1", "t1", ["foo", "bar"], ["bat", "bar"]
+ )
+ context.assert_(
+ "ALTER TABLE t1 ADD CONSTRAINT fk_test "
+ "FOREIGN KEY(foo, bar) REFERENCES t1 (bat, bar)"
+ )
+
def test_add_primary_key_constraint(self):
context = op_fixture()
op.create_primary_key("pk_test", "t1", ["foo", "bar"])