diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-10-08 17:02:55 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-10-08 17:02:55 -0400 |
| commit | 845500280d58a7c0cf6f08fb884b1428adb85635 (patch) | |
| tree | fe7c47f7762fe6bb0edb1dac0d029d63c92a16e6 /test/sql/test_metadata.py | |
| parent | 956c26d07712628457aef70cc8b2d85af2cc72f6 (diff) | |
| download | sqlalchemy-845500280d58a7c0cf6f08fb884b1428adb85635.tar.gz | |
- open up autoincrement for columns that have a default; autoinc is usually
"auto" now so True can indicate the dialect would support this
Diffstat (limited to 'test/sql/test_metadata.py')
| -rw-r--r-- | test/sql/test_metadata.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py index 24f416439..501df4671 100644 --- a/test/sql/test_metadata.py +++ b/test/sql/test_metadata.py @@ -1417,7 +1417,7 @@ class PKAutoIncrementTest(fixtures.TestBase): lambda: pk._autoincrement_column ) - def test_single_integer_illegal_default(self): + def test_single_integer_default(self): t = Table( 't', MetaData(), Column('a', Integer, autoincrement=True, default=lambda: 1)) @@ -1426,13 +1426,12 @@ class PKAutoIncrementTest(fixtures.TestBase): ) t.append_constraint(pk) - assert_raises_message( - exc.ArgumentError, - "Column default.*on column t.a is not compatible", - lambda: pk._autoincrement_column - ) + is_(pk._autoincrement_column, t.c.a) - def test_single_integer_illegal_server_default(self): + def test_single_integer_server_default(self): + # new as of 1.1; now that we have three states for autoincrement, + # if the user puts autoincrement=True with a server_default, trust + # them on it t = Table( 't', MetaData(), Column('a', Integer, @@ -1442,11 +1441,7 @@ class PKAutoIncrementTest(fixtures.TestBase): ) t.append_constraint(pk) - assert_raises_message( - exc.ArgumentError, - "Column server default.*on column t.a is not compatible", - lambda: pk._autoincrement_column - ) + is_(pk._autoincrement_column, t.c.a) def test_implicit_autoinc_but_fks(self): m = MetaData() |
