Update of /cvsroot/sqlobject/SQLObject/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv18791/tests
Modified Files:
SQLObjectTest.py test.py
Log Message:
Firebird fixes:
* "name" is a reserved word; fixed tests.
* Limit/offset (slices)
* columnsFromSchema support
* ALTER TABLE fix
Index: SQLObjectTest.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/tests/SQLObjectTest.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** SQLObjectTest.py 27 Sep 2003 22:56:14 -0000 1.17
--- SQLObjectTest.py 1 Oct 2003 01:53:48 -0000 1.18
***************
*** 47,54 ****
def firebirdConnection():
! SQLObjectTest.supportDynamic = False
SQLObjectTest.supportAuto = False
SQLObjectTest.supportRestrictedEnum = True
! SQLObjectTest.supportTransactions = False
return FirebirdConnection('localhost', '/var/lib/firebird/data/test.gdb',
user='sysdba', passwd='masterkey')
--- 47,54 ----
def firebirdConnection():
! SQLObjectTest.supportDynamic = True
SQLObjectTest.supportAuto = False
SQLObjectTest.supportRestrictedEnum = True
! SQLObjectTest.supportTransactions = True
return FirebirdConnection('localhost', '/var/lib/firebird/data/test.gdb',
user='sysdba', passwd='masterkey')
Index: test.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** test.py 27 Sep 2003 22:55:40 -0000 1.32
--- test.py 1 Oct 2003 01:53:48 -0000 1.33
***************
*** 27,31 ****
class TestSO1(SQLObject):
! name = StringCol(length=50)
_cacheValues = False
_columns = [
--- 27,31 ----
class TestSO1(SQLObject):
! name = StringCol(length=50, dbName='name_col')
_cacheValues = False
_columns = [
***************
*** 70,74 ****
class TestSO2(SQLObject):
! name = StringCol(length=50)
passwd = StringCol(length=10)
--- 70,74 ----
class TestSO2(SQLObject):
! name = StringCol(length=50, dbName='name_col')
passwd = StringCol(length=10)
***************
*** 82,86 ****
class TestSO3(SQLObject):
! name = StringCol(length=10)
other = ForeignKey('TestSO4', default=None)
other2 = KeyCol(foreignKey='TestSO4', default=None)
--- 82,86 ----
class TestSO3(SQLObject):
! name = StringCol(length=10, dbName='name_col')
other = ForeignKey('TestSO4', default=None)
other2 = KeyCol(foreignKey='TestSO4', default=None)
***************
*** 127,130 ****
--- 127,132 ----
class Names(SQLObject):
+ _table = 'names_table'
+
fname = StringCol(length=30)
lname = StringCol(length=30)
***************
*** 159,163 ****
class IterTest(SQLObject):
! name = StringCol()
class IterationTestCase(SQLObjectTest):
--- 161,165 ----
class IterTest(SQLObject):
! name = StringCol(dbName='name_col')
class IterationTestCase(SQLObjectTest):
***************
*** 239,243 ****
class TestSOTrans(SQLObject):
#_cacheValues = False
! name = StringCol(length=10, alternateID=True)
_defaultOrderBy = 'name'
--- 241,245 ----
class TestSOTrans(SQLObject):
#_cacheValues = False
! name = StringCol(length=10, alternateID=True, dbName='name_col')
_defaultOrderBy = 'name'
***************
*** 371,375 ****
class Person(SQLObject):
! _columns = [StringCol('name', length=100)]
_defaultOrder = 'name'
--- 373,377 ----
class Person(SQLObject):
! _columns = [StringCol('name', length=100, dbName='name_col')]
_defaultOrder = 'name'
***************
*** 608,612 ****
class SyncTest(SQLObject):
! name = StringCol(length=50, alternateID=True)
class ExpireTest(SQLObjectTest):
--- 610,614 ----
class SyncTest(SQLObject):
! name = StringCol(length=50, alternateID=True, dbName='name_col')
class ExpireTest(SQLObjectTest):
***************
*** 621,630 ****
conn = SyncTest._connection
b = SyncTest.byName('bob')
! conn.query("UPDATE sync_test SET name = 'robert' WHERE id = %i"
% b.id)
self.assertEqual(b.name, 'bob')
b.expire()
self.assertEqual(b.name, 'robert')
! conn.query("UPDATE sync_test SET name = 'bobby' WHERE id = %i"
% b.id)
b.sync()
--- 623,632 ----
conn = SyncTest._connection
b = SyncTest.byName('bob')
! conn.query("UPDATE sync_test SET name_col = 'robert' WHERE id = %i"
% b.id)
self.assertEqual(b.name, 'bob')
b.expire()
self.assertEqual(b.name, 'robert')
! conn.query("UPDATE sync_test SET name_col = 'bobby' WHERE id = %i"
% b.id)
b.sync()
***************
*** 637,643 ****
class SOValidation(SQLObject):
! name = StringCol(validator=Validator.PlainText(), default='x')
name2 = StringCol(validator=Validator.ConfirmType(str), default='y')
! name3 = StringCol(validator=Validator.Wrapper(fromPython=int), default=100)
class ValidationTest(SQLObjectTest):
--- 639,645 ----
class SOValidation(SQLObject):
! name = StringCol(validator=Validator.PlainText(), default='x', dbName='name_col')
name2 = StringCol(validator=Validator.ConfirmType(str), default='y')
! name3 = IntCol(validator=Validator.Wrapper(fromPython=int), default=100)
class ValidationTest(SQLObjectTest):
|