[SQL-CVS] SQLObject/tests test.py,1.19,1.20
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <ian...@us...> - 2003-07-10 20:31:57
|
Update of /cvsroot/sqlobject/SQLObject/tests In directory sc8-pr-cvs1:/tmp/cvs-serv408/tests Modified Files: test.py Log Message: Added transaction test Index: test.py =================================================================== RCS file: /cvsroot/sqlobject/SQLObject/tests/test.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test.py 10 Jul 2003 19:16:52 -0000 1.19 --- test.py 10 Jul 2003 19:25:47 -0000 1.20 *************** *** 143,146 **** --- 143,164 ---- self.assertEqual(list(TestSO1.select('all')), []) + ######################################## + ## Transaction test + ######################################## + + class TransactionTest(SQLObjectTest): + + classes = [Names] + + def inserts(self): + Names.new(fname='bob', lname='jones') + + def testTransaction(self): + if not self.supportTransactions: return + trans = Names._connection.transaction() + Names.new(fname='joe', lname='jones', connection=trans) + trans.rollback() + self.assertEqual([n.fname for n in Names.select()], + ['bob']) |