From 3a4567a718c2f9f3d8b65acb81f0caefb4f1a2b5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 24 Oct 2013 16:13:32 -0400 Subject: - add migration notes for [ticket:2838] - have TypeDecorator use process_bind_param for literal values if no process_literal_param is set --- test/sql/test_types.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') 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", {}), -- cgit v1.2.1