From: Mike Bayer Date: Sat, 4 Oct 2008 16:09:16 +0000 (+0000) Subject: - added a few more assertions for [ticket:1165] X-Git-Tag: rel_0_5rc2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4871697774a512bebf0dd11866d3b0e8eb54b91;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - 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 --- diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index d859b90610..df994d689f 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 a3d813d0fb..2600cebd91 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()