summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
diff options
context:
space:
mode:
authorTim Tate <timttate@gmail.com>2016-02-02 15:20:02 -0800
committerTim Tate <timttate@gmail.com>2016-02-02 15:40:07 -0800
commitc9b03fa8afd52646aba8c59fc038330eeee6db60 (patch)
tree71ee7ebc3c7b226b7ddf226da4000683e30255d8 /test/sql/test_compiler.py
parent9149fd062b8b5f4d84902b4581288ab991fd25ce (diff)
downloadsqlalchemy-pr/232.tar.gz
fix passing literal_binds flag through for update and insertpr/232
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 85a9f77bc..00195c6bf 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -255,6 +255,22 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
literal_binds=True
)
+ def test_insert_literal_binds(self):
+ stmt = table1.insert().values(myid=3, name='jack')
+
+ self.assert_compile(
+ stmt,
+ "INSERT INTO mytable (myid, name) VALUES (3, 'jack')",
+ literal_binds=True)
+
+ def test_update_literal_binds(self):
+ stmt = table1.update().values(name='jack').where(table1.c.name == 'jill')
+
+ self.assert_compile(
+ stmt,
+ "UPDATE mytable SET name='jack' WHERE mytable.name = 'jill'",
+ literal_binds=True)
+
def test_select_precol_compile_ordering(self):
s1 = select([column('x')]).select_from(text('a')).limit(5).as_scalar()
s2 = select([s1]).limit(10)