diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-24 16:13:32 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-24 16:13:32 -0400 |
| commit | 3a4567a718c2f9f3d8b65acb81f0caefb4f1a2b5 (patch) | |
| tree | f73ded16750da5e0f3cdafab6109e484708d237f /test | |
| parent | f0678a6e54e9598b884b82f43e57f44661693cca (diff) | |
| download | sqlalchemy-3a4567a718c2f9f3d8b65acb81f0caefb4f1a2b5.tar.gz | |
- add migration notes for [ticket:2838]
- have TypeDecorator use process_bind_param for literal values if no
process_literal_param is set
Diffstat (limited to 'test')
| -rw-r--r-- | test/sql/test_types.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 30a00ca56..7fc5dc35c 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -287,6 +287,22 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL): literal_binds=True ) + def test_typedecorator_literal_render_fallback_bound(self): + # fall back to process_bind_param for literal + # value rendering. + class MyType(types.TypeDecorator): + impl = String + + def process_bind_param(self, value, dialect): + return "HI->%s<-THERE" % value + + self.assert_compile( + select([literal("test", MyType)]), + "SELECT 'HI->test<-THERE' AS anon_1", + dialect='default', + literal_binds=True + ) + def test_typedecorator_impl(self): for impl_, exp, kw in [ (Float, "FLOAT", {}), |
