diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-02-06 16:24:38 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-02-06 16:24:38 -0500 |
commit | 827b936bc0f43cfee374bf465e205747f77fe9f7 (patch) | |
tree | f73596a9364edcf9ba57255c6d3f2035b0d35941 /lib/sqlalchemy/testing/suite/test_sequence.py | |
parent | 2121c1690a17090a4027874751e90d02b4126fd2 (diff) | |
download | sqlalchemy-827b936bc0f43cfee374bf465e205747f77fe9f7.tar.gz |
- add an explicit test for sequences "optional"
Diffstat (limited to 'lib/sqlalchemy/testing/suite/test_sequence.py')
-rw-r--r-- | lib/sqlalchemy/testing/suite/test_sequence.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_sequence.py b/lib/sqlalchemy/testing/suite/test_sequence.py index 0b60aa5b7..366d509cc 100644 --- a/lib/sqlalchemy/testing/suite/test_sequence.py +++ b/lib/sqlalchemy/testing/suite/test_sequence.py @@ -18,6 +18,12 @@ class SequenceTest(fixtures.TablesTest): Column('data', String(50)) ) + Table('seq_opt_pk', metadata, + Column('id', Integer, Sequence('tab_id_seq', optional=True), + primary_key=True), + Column('data', String(50)) + ) + def test_insert_roundtrip(self): config.db.execute( self.tables.seq_pk.insert(), @@ -43,6 +49,16 @@ class SequenceTest(fixtures.TablesTest): r, 1 ) + @requirements.sequences_optional + def test_optional_seq(self): + r = config.db.execute( + self.tables.seq_opt_pk.insert(), + data="some data" + ) + eq_( + r.inserted_primary_key, + [1] + ) def _assert_round_trip(self, table, conn): |