summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLele Gaifax <lele@metapensiero.it>2007-12-12 17:24:56 +0000
committerLele Gaifax <lele@metapensiero.it>2007-12-12 17:24:56 +0000
commit16810e401139644d9d137d9a18b4d945318db35c (patch)
tree8b0c1a8915e48844f90026d6c85766a908b94395
parentbfb33f7959244e1ac15d3d713e0abbd49f7a5e31 (diff)
downloadsqlalchemy-16810e401139644d9d137d9a18b4d945318db35c.tar.gz
New simple test for Dialect.has_sequence()
-rw-r--r--test/engine/reflection.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/engine/reflection.py b/test/engine/reflection.py
index 0d2fa2818..d44ccaf17 100644
--- a/test/engine/reflection.py
+++ b/test/engine/reflection.py
@@ -781,6 +781,23 @@ class SchemaTest(PersistTest):
table2 = Table('table2', metadata, autoload=True, schema=schema)
metadata.drop_all()
+
+class HasSequenceTest(PersistTest):
+ def setUpAll(self):
+ global metadata, users
+ metadata = MetaData()
+ users = Table('users', metadata,
+ Column('user_id', Integer, Sequence('user_id_seq'), primary_key=True),
+ Column('user_name', String(40)),
+ )
+
+ @testing.supported('firebird', 'postgres', 'oracle')
+ def test_hassequence(self):
+ metadata.create_all(bind=testbase.db)
+ self.assertEqual(testbase.db.dialect.has_sequence(testbase.db, 'user_id_seq'), True)
+ metadata.drop_all(bind=testbase.db)
+ self.assertEqual(testbase.db.dialect.has_sequence(testbase.db, 'user_id_seq'), False)
+
+
if __name__ == "__main__":
testbase.main()
-