- The :meth:.TypeEngine.with_variant method will now accept a

type class as an argument which is internally converted to an
instance, using the same convention long established by other
constructs such as :class:`.Column`. fixes #3122
This commit is contained in:
Mike Bayer
2014-07-10 11:26:13 -04:00
parent 1fc440393a
commit e5d0fa9493
3 changed files with 17 additions and 1 deletions
+7
View File
@@ -816,6 +816,13 @@ class VariantTest(fixtures.TestBase, AssertsCompiledSQL):
dialect=dialects.postgresql.dialect()
)
def test_to_instance(self):
self.assert_compile(
self.UTypeOne().with_variant(self.UTypeTwo, "postgresql"),
"UTYPETWO",
dialect=dialects.postgresql.dialect()
)
def test_compile_composite(self):
self.assert_compile(
self.composite,