mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-08-09 23:10:07 -04:00
- 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user