diff options
author | Michael Trier <mtrier@gmail.com> | 2008-10-11 16:14:20 +0000 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2008-10-11 16:14:20 +0000 |
commit | 41e1f5526cf24131f6365de2c48f39748504daf2 (patch) | |
tree | fc87f0132b7fee1cca7870929286070dcb8e7bd2 /test/sql/defaults.py | |
parent | b3c39decc1b992bcb7c1bb7cad452dcea5991f20 (diff) | |
download | sqlalchemy-41e1f5526cf24131f6365de2c48f39748504daf2.tar.gz |
Removed the visit_function stuff in mssql dialect. Added some tests for the function overrides. Fixed up the test_select in the sql/defaults.py tests which was a mess.
Diffstat (limited to 'test/sql/defaults.py')
-rw-r--r-- | test/sql/defaults.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/sql/defaults.py b/test/sql/defaults.py index dfd626b72..d69174248 100644 --- a/test/sql/defaults.py +++ b/test/sql/defaults.py @@ -33,14 +33,13 @@ class DefaultTest(testing.TestBase): # since its a "branched" connection conn.close() - use_function_defaults = testing.against('postgres', 'oracle') + use_function_defaults = testing.against('postgres', 'mssql', 'maxdb') is_oracle = testing.against('oracle') # select "count(1)" returns different results on different DBs also # correct for "current_date" compatible as column default, value # differences currenttime = func.current_date(type_=sa.Date, bind=db) - if is_oracle: ts = db.scalar(sa.select([func.trunc(func.sysdate(), sa.literal_column("'DAY'"), type_=sa.Date).label('today')])) assert isinstance(ts, datetime.date) and not isinstance(ts, datetime.datetime) @@ -56,11 +55,13 @@ class DefaultTest(testing.TestBase): f = sa.select([func.length('abcdef')], bind=db).scalar() f2 = sa.select([func.length('abcdefghijk')], bind=db).scalar() def1 = currenttime + deftype = sa.Date if testing.against('maxdb'): def2 = sa.text("curdate") + elif testing.against('mssql'): + def2 = sa.text("getdate()") else: def2 = sa.text("current_date") - deftype = sa.Date ts = db.func.current_date().scalar() else: f = len('abcdef') |