diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-14 20:21:36 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-14 20:21:36 +0000 |
| commit | 437f1ce670e84964dc701488ac09af565ba807f7 (patch) | |
| tree | e6a92d2850af4695d3651e29cd8b72cc10872c26 /test/sql | |
| parent | 5b4871f4364c7b93de010097aa8f4008f69bddd4 (diff) | |
| download | sqlalchemy-437f1ce670e84964dc701488ac09af565ba807f7.tar.gz | |
- postgres cursor option is now server_side_cursors=False; some users get bad results using them
so theyre off by default
- type system slightly modified to support TypeDecorators that can be overridden by the dialect
- added an NVarchar type to mssql (produces NVARCHAR), also MSUnicode which provides Unicode-translation
for the NVarchar regardless of dialect convert_unicode setting.
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/testtypes.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index 2700ec6c7..8889b7b34 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -60,7 +60,20 @@ class AdaptTest(PersistTest): assert (t1.impl.length == 20) assert isinstance(t2.impl, TEXT) assert t2.impl.length is None - + + + def testdialecttypedecorators(self): + """test that a a Dialect can provide a dialect-specific subclass of a TypeDecorator subclass.""" + import sqlalchemy.databases.mssql as mssql + dialect = mssql.MSSQLDialect() + # run the test twice to insure the caching step works too + for x in range(0, 1): + col = Column('', Unicode(length=10)) + dialect_type = col.type.dialect_impl(dialect) + assert isinstance(dialect_type, mssql.MSUnicode) + assert dialect_type.get_col_spec() == 'NVARCHAR(10)' + assert isinstance(dialect_type.impl, mssql.MSString) + class OverrideTest(PersistTest): """tests user-defined types, including a full type as well as a TypeDecorator""" @@ -166,6 +179,7 @@ class UnicodeTest(AssertMixin): self.assert_(isinstance(x['plain_data'], unicode) and x['plain_data'] == unicodedata) finally: db.engine.dialect.convert_unicode = prev_unicode + class BinaryTest(AssertMixin): |
