dabo Commit
Revision 5409
Date: 2009-09-22 14:55:18 -0700 (Tue, 22 Sep 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5409

Changed:
U   trunk/dabo/biz/test/test_dBizobj.py

Log:
Added a test for dBizobj that calls cancelAll() where there are multiple
changed parent records. It doesn't cancel all the children (only the 
active child), ever since r5339. See ticket #1264.



Diff:
Modified: trunk/dabo/biz/test/test_dBizobj.py
===================================================================
--- trunk/dabo/biz/test/test_dBizobj.py 2009-09-22 21:31:27 UTC (rev 5408)
+++ trunk/dabo/biz/test/test_dBizobj.py 2009-09-22 21:55:18 UTC (rev 5409)
@@ -571,7 +571,7 @@
                self.assertEqual(bizMain.RowNumber, 0)
                self.assertEqual(bizChild.RowNumber, 0)
 
-       def testChangesToTwoChildRecords(self):
+       def testChangesToTwoChildRecords(self, mode="save"):
                """After the dabo web server stuff and the @remote calls got 
added, only
                a single record from child bizobjs seem to get saved.
                """
@@ -608,12 +608,18 @@
                self.assertEqual(bizMain.isAnyChanged(), True)
                self.assertEqual(bizMain.getChangedRows(), [0])
                self.assertEqual(bizChild.getChangedRows(), [0,1])
-               bizMain.save()
+               if mode == "save":
+                       bizMain.save()
+               elif mode == "cancel":
+                       bizMain.cancelAll()
                self.assertEqual(bizChild2.getChangedRows(), [])
                self.assertEqual(bizChild.getChangedRows(), [])
                self.assertEqual(bizMain.getChangedRows(), [])
                self.assertEqual(bizMain.isAnyChanged(), False)
 
+       def testChangesToTwoChildRecords_cancel(self):
+               """Do the same test as for save, but with cancelAll()."""
+               self.testChangesToTwoChildRecords("cancel")
                
 if __name__ == "__main__":
        suite = unittest.TestLoader().loadTestsFromTestCase(Test_dBizobj)




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to