]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added explicit length to more testing String columns.
authorJason Kirtland <jek@discorporate.us>
Wed, 9 Jan 2008 20:29:04 +0000 (20:29 +0000)
committerJason Kirtland <jek@discorporate.us>
Wed, 9 Jan 2008 20:29:04 +0000 (20:29 +0000)
test/ext/activemapper.py
test/ext/associationproxy.py
test/ext/orderinglist.py

index 860f52813e0b71806cd9280c245b117b0c1ddf3d..7461ed2578d4b02ef9e137ccadbf60355d380747 100644 (file)
@@ -19,16 +19,16 @@ class testcase(PersistTest):
         class Person(ActiveMapper):
             class mapping:
                 __version_id_col__ = 'row_version'
-                full_name   = column(String)
-                first_name  = column(String)
-                middle_name = column(String)
-                last_name   = column(String)
+                full_name   = column(String(128))
+                first_name  = column(String(128))
+                middle_name = column(String(128))
+                last_name   = column(String(128))
                 birth_date  = column(DateTime)
-                ssn         = column(String)
-                gender      = column(String)
-                home_phone  = column(String)
-                cell_phone  = column(String)
-                work_phone  = column(String)
+                ssn         = column(String(128))
+                gender      = column(String(128))
+                home_phone  = column(String(128))
+                cell_phone  = column(String(128))
+                work_phone  = column(String(128))
                 row_version = column(Integer, default=0)
                 prefs_id    = column(Integer, foreign_key=ForeignKey('preferences.id'))
                 addresses   = one_to_many('Address', colname='person_id', backref='person', order_by=['state', 'city', 'postal_code'])
@@ -50,7 +50,7 @@ class testcase(PersistTest):
             class mapping:
                 __table__        = 'preferences'
                 favorite_color   = column(String(128))
-                personality_type = column(String)
+                personality_type = column(String(128))
 
         class Address(ActiveMapper):
             class mapping:
@@ -59,10 +59,10 @@ class testcase(PersistTest):
                 # then ActiveMapper will not add an integer primary key
                 # for you.
                 id          = column(Integer, primary_key=True)
-                type        = column(String)
-                address_1   = column(String)
-                city        = column(String)
-                state       = column(String)
+                type        = column(String(128))
+                address_1   = column(String(128))
+                city        = column(String(128))
+                state       = column(String(128))
                 postal_code = column(String(128))
                 person_id   = column(Integer, foreign_key=ForeignKey('person.id'))
 
index cc402033971a7e30ba234d465275ae3e0624743a..7195e4480e0d09a0a9d16347c1873b12dbe61421 100644 (file)
@@ -41,13 +41,13 @@ class _CollectionOperations(PersistTest):
 
         parents_table = Table('Parent', metadata,
                               Column('id', Integer, primary_key=True),
-                              Column('name', String))
+                              Column('name', String(128)))
         children_table = Table('Children', metadata,
                                Column('id', Integer, primary_key=True),
                                Column('parent_id', Integer,
                                       ForeignKey('Parent.id')),
-                               Column('foo', String),
-                               Column('name', String))
+                               Column('foo', String(128)),
+                               Column('name', String(128)))
 
         class Parent(object):
             children = association_proxy('_children', 'name')
@@ -592,14 +592,14 @@ class ScalarTest(PersistTest):
 
         parents_table = Table('Parent', metadata,
                               Column('id', Integer, primary_key=True),
-                              Column('name', String))
+                              Column('name', String(128)))
         children_table = Table('Children', metadata,
                                Column('id', Integer, primary_key=True),
                                Column('parent_id', Integer,
                                       ForeignKey('Parent.id')),
-                               Column('foo', String),
-                               Column('bar', String),
-                               Column('baz', String))
+                               Column('foo', String(128)),
+                               Column('bar', String(128)),
+                               Column('baz', String(128)))
 
         class Parent(object):
             foo = association_proxy('child', 'foo')
@@ -709,13 +709,13 @@ class LazyLoadTest(PersistTest):
 
         parents_table = Table('Parent', metadata,
                               Column('id', Integer, primary_key=True),
-                              Column('name', String))
+                              Column('name', String(128)))
         children_table = Table('Children', metadata,
                                Column('id', Integer, primary_key=True),
                                Column('parent_id', Integer,
                                       ForeignKey('Parent.id')),
-                               Column('foo', String),
-                               Column('name', String))
+                               Column('foo', String(128)),
+                               Column('name', String(128)))
 
         class Parent(object):
             children = association_proxy('_children', 'name')
index d16e20da73a228e4e938e4981e6219168f709133..2c7c6a16f6d5e09808c02fb4753465aff1220e8c 100644 (file)
@@ -54,13 +54,13 @@ class OrderingListTest(PersistTest):
         metadata = MetaData(testbase.db)
         slides_table = Table('test_Slides', metadata,
                              Column('id', Integer, primary_key=True),
-                             Column('name', String))
+                             Column('name', String(128)))
         bullets_table = Table('test_Bullets', metadata,
                               Column('id', Integer, primary_key=True),
                               Column('slide_id', Integer,
                                      ForeignKey('test_Slides.id')),
                               Column('position', Integer),
-                              Column('text', String))
+                              Column('text', String(128)))
 
         class Slide(object):
             def __init__(self, name):