diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-13 18:53:21 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-02-13 18:53:21 -0500 |
commit | 4bbd814fffb563e38f776d7c11ab162f8095ca51 (patch) | |
tree | 02aee0327473b057b16af95fac8440a4ba56c86a /test/dialect/test_postgresql.py | |
parent | 1aeb637e70e4f9f098ab8b4c4462975b805e9965 (diff) | |
download | sqlalchemy-4bbd814fffb563e38f776d7c11ab162f8095ca51.tar.gz |
- [bug] Fixed the "render literal bind" function,
used by Alembic, to escape % signs with %%.
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r-- | test/dialect/test_postgresql.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index 769f18ce9..a537ee3e9 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -74,6 +74,18 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): 'RETURNING length(mytable.name) AS length_1' , dialect=dialect) + def test_render_literal(self): + dialect = postgresql.dialect() + compiler = dialect.statement_compiler(dialect, None) + for value, exp in [ + ('hi', "'hi'"), + ("with 'quotes'", "'with ''quotes'''"), + ('%.%', "'%%.%%'") + ]: + eq_( + compiler.render_literal_value(value, None), + exp + ) def test_insert_returning(self): dialect = postgresql.dialect() |