diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-01-18 15:06:08 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-01-18 15:06:08 -0500 |
| commit | 6e4fd0aea858338deca58f0e41bb01a584a79d39 (patch) | |
| tree | a28e94a3d578ff49ea469abd33a2aab526d7445f /test/sql | |
| parent | 931655f41743a99521f60ebbd0b9199422099013 (diff) | |
| parent | cf8e5e3cf5b0e1be05a611c8828690acfcd2b9fa (diff) | |
| download | sqlalchemy-6e4fd0aea858338deca58f0e41bb01a584a79d39.tar.gz | |
Merge branch 'patch-msql-pkc-clustered' of bitbucket.org:dharland/sqlalchemy into m
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_constraints.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/sql/test_constraints.py b/test/sql/test_constraints.py index 393bcd448..cb4b73ec8 100644 --- a/test/sql/test_constraints.py +++ b/test/sql/test_constraints.py @@ -544,6 +544,28 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL): "FOREIGN KEY(foo_bar) REFERENCES foo (bar))" ) + def test_empty_pkc(self): + # test that an empty primary key is ignored + metadata = MetaData() + tbl = Table('test', metadata, + Column('x', Integer, autoincrement=False), + Column('y', Integer, autoincrement=False), + PrimaryKeyConstraint()) + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE test (x INTEGER, y INTEGER)" + ) + + def test_empty_uc(self): + # test that an empty constraint is ignored + metadata = MetaData() + tbl = Table('test', metadata, + Column('x', Integer, autoincrement=False), + Column('y', Integer, autoincrement=False), + UniqueConstraint()) + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE test (x INTEGER, y INTEGER)" + ) + def test_deferrable_column_check(self): t = Table('tbl', MetaData(), Column('a', Integer), |
