Author: phd
Date: Fri Aug 16 13:34:59 2013
New Revision: 4642
Log:
Patches from Neil Muller to run tests with MySQL
Modified:
SQLObject/branches/1.5/sqlobject/inheritance/tests/test_deep_inheritance.py
SQLObject/branches/1.5/sqlobject/inheritance/tests/test_indexes.py
SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py
SQLObject/branches/1.5/sqlobject/tests/test_groupBy.py
SQLObject/branches/1.5/sqlobject/tests/test_indexes.py
SQLObject/branches/1.5/sqlobject/tests/test_select.py
Modified: SQLObject/branches/1.5/sqlobject/inheritance/tests/test_deep_inheritance.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/inheritance/tests/test_deep_inheritance.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/inheritance/tests/test_deep_inheritance.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -8,12 +8,12 @@
########################################
class DIPerson(InheritableSQLObject):
- firstName = StringCol()
+ firstName = StringCol(length=100)
lastName = StringCol(alternateID=True, length=255)
manager = ForeignKey("DIManager", default=None)
class DIEmployee(DIPerson):
- position = StringCol(unique=True)
+ position = StringCol(unique=True, length=100)
class DIManager(DIEmployee):
subdudes = MultipleJoin("DIPerson", joinColumn="manager_id")
Modified: SQLObject/branches/1.5/sqlobject/inheritance/tests/test_indexes.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/inheritance/tests/test_indexes.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/inheritance/tests/test_indexes.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -4,8 +4,8 @@
class InheritedPersonIndexGet(InheritableSQLObject):
- first_name = StringCol(notNone=True)
- last_name = StringCol(notNone=True)
+ first_name = StringCol(notNone=True, length=100)
+ last_name = StringCol(notNone=True, length=100)
age = IntCol()
pk = DatabaseIndex(first_name, last_name, unique=True)
Modified: SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -7,7 +7,7 @@
########################################
class TestException(SQLObject):
- name = StringCol(unique=True)
+ name = StringCol(unique=True, length=100)
def test_exceptions():
if not supports("exceptions"):
Modified: SQLObject/branches/1.5/sqlobject/tests/test_groupBy.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_groupBy.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/tests/test_groupBy.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -22,7 +22,7 @@
orderBy=GroupbyTest.q.name)
sql = connection.sqlrepr(select)
rows = connection.queryAll(sql)
- assert rows == [('a', 2), ('b', 1)]
+ assert list(rows) == [('a', 2), ('b', 1)]
def test_groupBy_list():
setupClass(GroupbyTest)
@@ -36,4 +36,4 @@
orderBy=[GroupbyTest.q.name, GroupbyTest.q.value])
sql = connection.sqlrepr(select)
rows = connection.queryAll(sql)
- assert rows == [('a', 1), ('a', 2), ('b', 1)]
+ assert list(rows) == [('a', 1), ('a', 2), ('b', 1)]
Modified: SQLObject/branches/1.5/sqlobject/tests/test_indexes.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_indexes.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/tests/test_indexes.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -15,7 +15,7 @@
nameIndex3 = DatabaseIndex({'column': name,
'length': 3})
class SOIndex2(SQLObject):
- name = StringCol()
+ name = StringCol(length=100)
nameIndex = DatabaseIndex({'expression': 'lower(name)'})
def test_indexes_1():
@@ -44,8 +44,8 @@
class PersonIndexGet(SQLObject):
- firstName = StringCol()
- lastName = StringCol()
+ firstName = StringCol(length=100)
+ lastName = StringCol(length=100)
age = IntCol(alternateID=True)
nameIndex = DatabaseIndex(firstName, lastName, unique=True)
@@ -90,13 +90,13 @@
class PersonIndexGet2(SQLObject):
- name = StringCol(alternateID=True)
+ name = StringCol(alternateID=True, length=100)
age = IntCol()
addresses = MultipleJoin('AddressIndexGet2')
class AddressIndexGet2(SQLObject):
person = ForeignKey('PersonIndexGet2', notNone=True)
- type = StringCol(notNone=True)
+ type = StringCol(notNone=True, length=100)
street = StringCol(notNone=True)
pk = DatabaseIndex(person, type, unique=True)
Modified: SQLObject/branches/1.5/sqlobject/tests/test_select.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_select.py Fri Aug 16 13:33:02 2013 (r4641)
+++ SQLObject/branches/1.5/sqlobject/tests/test_select.py Fri Aug 16 13:34:59 2013 (r4642)
@@ -5,7 +5,7 @@
from dbtest import setSQLiteConnectionFactory
class IterTest(SQLObject):
- name = StringCol(dbName='name_col')
+ name = StringCol(dbName='name_col', length=200)
names = ('a', 'b', 'c')
def setupIter():
@@ -113,7 +113,7 @@
assert False, "IterTest(nonexistant='b') should raise TypeError"
class UniqTest(SQLObject):
- name = StringCol(dbName='name_col', unique=True)
+ name = StringCol(dbName='name_col', unique=True, length=100)
def test_by_uniq():
setupClass(UniqTest)
|