diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-03-26 13:29:57 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-03-26 13:29:57 -0400 |
| commit | c8fca639c914e79b1bffe6f6546b49f474255701 (patch) | |
| tree | f4b722d1892f6c835b30401450e90235506bc1b8 /test/sql/test_text.py | |
| parent | 8acbc2624fb4b457e47fab93e6a44a1e37caeddc (diff) | |
| download | sqlalchemy-c8fca639c914e79b1bffe6f6546b49f474255701.tar.gz | |
Test double colons without escaping in text()
Apparently the BIND_PARAMS regex passes over double colons,
it just doesn't accommodate for a bound parameter in that case.
add this use case to current tests as people can be relying upon it.
Change-Id: I6555621b1bb05d09b17428f4b4094ff7b219b460
Diffstat (limited to 'test/sql/test_text.py')
| -rw-r--r-- | test/sql/test_text.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_text.py b/test/sql/test_text.py index bcaf905fe..188ac3878 100644 --- a/test/sql/test_text.py +++ b/test/sql/test_text.py @@ -331,6 +331,19 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL): dialect="postgresql", ) + def test_double_colons_dont_actually_need_escaping(self): + # this is news to me. bound param won't work but you can put the + # double colons in + self.assert_compile( + text( + r"SELECT * FROM pg_attribute WHERE " + r"attrelid = foo::regclass" + ), + "SELECT * FROM pg_attribute WHERE " "attrelid = foo::regclass", + params={}, + dialect="postgresql", + ) + def test_text_in_select_nonfrom(self): generate_series = text( |
