]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added a few more assertions for [ticket:1165]
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Oct 2008 16:09:16 +0000 (16:09 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Oct 2008 16:09:16 +0000 (16:09 +0000)
- removed non-2.5 partial.keywords, partial.name, etc., not sure what those are getting us here

lib/sqlalchemy/schema.py
test/sql/testtypes.py

index d859b9061090cd2462bdd7a314bd0328e21d29a0..df994d689fa716b7e8e0eca1bc6f79080ddca42a 100644 (file)
@@ -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]()
 
index a3d813d0fb4848ec3ce51a099e6f2660d8d90e3b..2600cebd91aab0a0ad909df12be9d9e2e15862e8 100644 (file)
@@ -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()