summaryrefslogtreecommitdiff
path: root/test/sql/test_insert.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-01 15:41:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-01 15:41:57 -0400
commit6bdd3bb93fd18a4aec54ee2a836875a922dcaab3 (patch)
tree5a273d46e0e95cdc208f785385338b511fa8feae /test/sql/test_insert.py
parent5ee1bb09de3b9675d482d608a0474c89f93259e4 (diff)
downloadsqlalchemy-6bdd3bb93fd18a4aec54ee2a836875a922dcaab3.tar.gz
- reinstate insert returning back into test_insert.py; defaultdialect
needs to be explicit here since tablestest sticks testing.db onto metadata.bind
Diffstat (limited to 'test/sql/test_insert.py')
-rw-r--r--test/sql/test_insert.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/sql/test_insert.py b/test/sql/test_insert.py
index c74e11e18..cd040538f 100644
--- a/test/sql/test_insert.py
+++ b/test/sql/test_insert.py
@@ -109,6 +109,16 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
self.assert_compile(table.insert(inline=True),
'INSERT INTO sometable (foo) VALUES (foobar())', params={})
+ def test_insert_returning_not_in_default(self):
+ table1 = self.tables.mytable
+
+ stmt = table1.insert().returning(table1.c.myid)
+ assert_raises_message(
+ exc.CompileError,
+ "RETURNING is not supported by this dialect's statement compiler.",
+ stmt.compile,
+ dialect=default.DefaultDialect()
+ )
class EmptyTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
__dialect__ = 'default'