From 4c705b6089ce265e4878751f2a9702e02bc99a57 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Wed, 9 Jan 2008 20:29:04 +0000 Subject: [PATCH] Added explicit length to more testing String columns. --- test/ext/activemapper.py | 28 ++++++++++++++-------------- test/ext/associationproxy.py | 20 ++++++++++---------- test/ext/orderinglist.py | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/ext/activemapper.py b/test/ext/activemapper.py index 860f52813e..7461ed2578 100644 --- a/test/ext/activemapper.py +++ b/test/ext/activemapper.py @@ -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')) diff --git a/test/ext/associationproxy.py b/test/ext/associationproxy.py index cc40203397..7195e4480e 100644 --- a/test/ext/associationproxy.py +++ b/test/ext/associationproxy.py @@ -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') diff --git a/test/ext/orderinglist.py b/test/ext/orderinglist.py index d16e20da73..2c7c6a16f6 100644 --- a/test/ext/orderinglist.py +++ b/test/ext/orderinglist.py @@ -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): -- 2.47.3