diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-10-04 16:09:16 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-10-04 16:09:16 +0000 |
| commit | f4871697774a512bebf0dd11866d3b0e8eb54b91 (patch) | |
| tree | 4810fa2c45ad1eb6a516bdf14acded4a8f9d5eeb | |
| parent | dc5f360cd3e94f43f90b7cee3c8b5ba3de2e26cf (diff) | |
| download | sqlalchemy-f4871697774a512bebf0dd11866d3b0e8eb54b91.tar.gz | |
- added a few more assertions for [ticket:1165]
- removed non-2.5 partial.keywords, partial.name, etc., not sure what those are getting us here
| -rw-r--r-- | lib/sqlalchemy/schema.py | 2 | ||||
| -rw-r--r-- | test/sql/testtypes.py | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index d859b9061..df994d689 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -548,6 +548,8 @@ class Column(SchemaItem, expression._ColumnClause): name = args.pop(0) if args: coltype = args[0] + + # adjust for partials if callable(coltype): coltype = args[0]() diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index a3d813d0f..2600cebd9 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -805,12 +805,9 @@ except: newkeywords = keywords.copy() newkeywords.update(fkeywords) return func(*(args + fargs), **newkeywords) - newfunc.func = func - newfunc.args = args - newfunc.keywords = keywords return newfunc -class CallableTest(TestBase, AssertsExecutionResults): +class CallableTest(TestBase): def setUpAll(self): global meta meta = MetaData(testing.db) @@ -824,6 +821,8 @@ class CallableTest(TestBase, AssertsExecutionResults): thing_table = Table('thing', meta, Column('name', ucode, primary_key=True) ) + assert isinstance(thing_table.c.name.type, Unicode) + thing_table.create() def test_callable_as_kwarg(self): ucode = partial(Unicode, assert_unicode=None) @@ -831,6 +830,8 @@ class CallableTest(TestBase, AssertsExecutionResults): thang_table = Table('thang', meta, Column('name', type_=ucode, primary_key=True) ) + assert isinstance(thang_table.c.name.type, Unicode) + thang_table.create() if __name__ == "__main__": testenv.main() |
