From: Mike Bayer Date: Tue, 27 Dec 2011 22:03:53 +0000 (-0500) Subject: add test for #2193 X-Git-Tag: rel_0_7_5~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45e3b4d0c56321890c52e69f6eb36868ab3c2173;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add test for #2193 --- diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 1902c74c28..793d5cb125 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -364,6 +364,19 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL): "MYTYPE foo TWO" ) + def test_user_defined_dialect_specific_args(self): + class MyType(types.UserDefinedType): + def __init__(self, foo='foo', **kwargs): + super(MyType, self).__init__() + self.foo = foo + self.dialect_specific_args = kwargs + def adapt(self, cls): + return cls(foo=self.foo, **self.dialect_specific_args) + t = MyType(bar='bar') + a = t.dialect_impl(testing.db.dialect) + eq_(a.foo, 'foo') + eq_(a.dialect_specific_args['bar'], 'bar') + @testing.provide_metadata def test_type_coerce(self): """test ad-hoc usage of custom types with type_coerce()."""