[SQL-CVS] SQLObject/tests test.py,1.16,1.17
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-06-26 08:33:59
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv4120/tests Modified Files: test.py Log Message: * Made descending ordering work * Made ordering with joins more robust Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test.py 31 May 2003 01:59:45 -0000 1.16 --- test.py 26 Jun 2003 08:33:56 -0000 1.17 *************** *** 89,93 **** self.assertEqual(tc3.other2, tc4d) self.assertEqual(tc3.other2ID, tc4d.id) ! --- 89,96 ---- self.assertEqual(tc3.other2, tc4d) self.assertEqual(tc3.other2ID, tc4d.id) ! tcc = TestSO3.new(name='b', other=tc4a) ! self.assertEqual(tcc.other, tc4a) ! tcc2 = TestSO3.new(name='c', other=tc4a.id) ! self.assertEqual(tcc2.other, tc4a) *************** *** 176,179 **** --- 179,188 ---- range(0, 90)) + def test5(self): + self.counterEqual(Counter.select('all', orderBy='number', reversed=True), range(99, -1, -1)) + + def test6(self): + self.counterEqual(Counter.select('all', orderBy='-number'), range(99, -1, -1)) + ######################################## *************** *** 257,261 **** Phone.delColumn(col, changeSchema=True) Person.delJoin(join) - ######################################## --- 266,269 ---- *************** *** 368,373 **** _columns = [StringCol('zip', length=5), ForeignKey('PersonJoiner2')] ! # KeyCol('personJoiner2ID', foreignKey='PersonJoiner2')] class JoinTest2(SQLObjectTest): --- 376,382 ---- _columns = [StringCol('zip', length=5), + StringCol('plus4', length=4, default=None), ForeignKey('PersonJoiner2')] ! _defaultOrder = ['-zip', 'plus4'] class JoinTest2(SQLObjectTest): *************** *** 396,400 **** z = AddressJoiner2(id) self.assertEqual(z.zip, 'xxxxx') ! --- 405,413 ---- z = AddressJoiner2(id) self.assertEqual(z.zip, 'xxxxx') ! ! def testDefaultOrder(self): ! p1 = PersonJoiner2.byName('bob') ! self.assertEqual([i.zip for i in p1.addressJoiner2s], ! ['33333', '22222', '11111']) |