[SQL-CVS] SQLObject/tests test.py,1.18,1.19
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-07-10 20:56:17
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv31330/tests Modified Files: test.py Log Message: Added test for lists of orderBy Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test.py 28 Jun 2003 22:20:55 -0000 1.18 --- test.py 10 Jul 2003 19:16:52 -0000 1.19 *************** *** 96,101 **** ! ######################################## --- 96,131 ---- ! ######################################## ! ## Fancy sort ! ######################################## ! ! class Names(SQLObject): ! ! fname = StringCol(length=30) ! lname = StringCol(length=30) ! ! _defaultOrder = ['lname', 'fname'] ! ! class NamesTest(SQLObjectTest): ! ! classes = [Names] ! ! def inserts(self): ! for fname, lname in [('aj', 'baker'), ('joe', 'robbins'), ! ('tim', 'jackson'), ('joe', 'baker'), ! ('zoe', 'robbins')]: ! Names.new(fname=fname, lname=lname) ! ! def testDefaultOrder(self): ! self.assertEqual([(n.fname, n.lname) for n in Names.select()], ! [('aj', 'baker'), ('joe', 'baker'), ! ('tim', 'jackson'), ('joe', 'robbins'), ! ('zoe', 'robbins')]) + def testOtherOrder(self): + self.assertEqual([(n.fname, n.lname) for n in Names.select().orderBy(['fname', 'lname'])], + [('aj', 'baker'), ('joe', 'baker'), + ('joe', 'robbins'), ('tim', 'jackson'), + ('zoe', 'robbins')]) ######################################## |