Update of /cvsroot/sqlobject/SQLObject/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv12846/tests
Modified Files:
test.py
Log Message:
Test for new-style column definitions.
Index: test.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test.py 6 May 2003 22:43:35 -0000 1.12
--- test.py 12 May 2003 01:22:48 -0000 1.13
***************
*** 20,23 ****
--- 20,24 ----
classes = [TestSO1]
+ MyClass = TestSO1
info = [('bob', 'god'), ('sally', 'sordid'),
***************
*** 26,33 ****
def inserts(self):
for name, passwd in self.info:
! TestSO1.new(name=name, passwd=passwd)
def testGet(self):
! bob = TestSO1.selectBy(name='bob')[0]
self.assertEqual(bob.name, 'bob')
self.assertEqual(bob.passwd, 'god'.encode('rot13'))
--- 27,34 ----
def inserts(self):
for name, passwd in self.info:
! self.MyClass.new(name=name, passwd=passwd)
def testGet(self):
! bob = self.MyClass.selectBy(name='bob')[0]
self.assertEqual(bob.name, 'bob')
self.assertEqual(bob.passwd, 'god'.encode('rot13'))
***************
*** 41,44 ****
--- 42,57 ----
self.assertEqual(bob.name, 'joe')
+
+ class TestSO2(SQLObject):
+ name = StringCol(length=10)
+ passwd = StringCol(length=10)
+
+ def _set_passwd(self, passwd):
+ self._SO_set_passwd(passwd.encode('rot13'))
+
+ class TestCase2(TestCase1):
+
+ classes = [TestSO2]
+ MyClass = TestSO2
########################################
|