diff options
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 9be76130d..5e5c4f9bd 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -56,6 +56,7 @@ from sqlalchemy.testing import fixtures from sqlalchemy.testing.assertions import assert_raises from sqlalchemy.testing.assertions import assert_raises_message from sqlalchemy.testing.assertions import AssertsCompiledSQL +from sqlalchemy.testing.assertions import eq_ignore_whitespace from sqlalchemy.testing.assertions import expect_warnings from sqlalchemy.testing.assertions import is_ from sqlalchemy.util import OrderedDict @@ -101,6 +102,21 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = postgresql.dialect() + def test_plain_stringify_returning(self): + t = Table( + "t", + MetaData(), + Column("myid", Integer, primary_key=True), + Column("name", String, server_default="some str"), + Column("description", String, default=func.lower("hi")), + ) + stmt = t.insert().values().return_defaults() + eq_ignore_whitespace( + str(stmt.compile(dialect=postgresql.dialect())), + "INSERT INTO t (description) VALUES (lower(%(lower_1)s)) " + "RETURNING t.myid, t.name, t.description", + ) + def test_update_returning(self): dialect = postgresql.dialect() table1 = table( |