summaryrefslogtreecommitdiff
path: root/test/sql/test_constraints.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-03-09 18:05:21 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-03-09 18:05:21 -0500
commit6be35e3898c7a7726744dc2590598e0a5a20c76b (patch)
tree38393bf995f3b9a3dbb058ddda7e031a88152839 /test/sql/test_constraints.py
parenta0de45185bf510fca9e237d9191e89391d118591 (diff)
downloadsqlalchemy-6be35e3898c7a7726744dc2590598e0a5a20c76b.tar.gz
- auto-append for CheckConstraint should skip table if the expression is against
a lower-case-t table
Diffstat (limited to 'test/sql/test_constraints.py')
-rw-r--r--test/sql/test_constraints.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py
index ab294e1eb..026095c3b 100644
--- a/test/sql/test_constraints.py
+++ b/test/sql/test_constraints.py
@@ -7,6 +7,7 @@ from sqlalchemy import testing
from sqlalchemy.testing import engines
from sqlalchemy.testing import eq_
from sqlalchemy.testing.assertsql import AllOf, RegexSQL, ExactSQL, CompiledSQL
+from sqlalchemy.sql import table, column
class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
__dialect__ = 'default'
@@ -753,6 +754,18 @@ class ConstraintAPITest(fixtures.TestBase):
c = Index('foo', t.c.a)
assert c in t.indexes
+ def test_auto_append_lowercase_table(self):
+ t = table('t', column('a'))
+ t2 = table('t2', column('a'))
+ for c in (
+ UniqueConstraint(t.c.a),
+ CheckConstraint(t.c.a > 5),
+ ForeignKeyConstraint([t.c.a], [t2.c.a]),
+ PrimaryKeyConstraint(t.c.a),
+ Index('foo', t.c.a)
+ ):
+ assert True
+
def test_tometadata_ok(self):
m = MetaData()