Changeset 3069

Show
Ignore:
Timestamp:
04/19/07 10:07:56 (2 years ago)
Author:
paul
Message:

Added a failing test case to the dBizobj test to show that adding a child
record and then canceling the parent record doesn't result in the child
record being removed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/biz/test/test_dBizobj.py

    r3054 r3069  
    183183        self.assertEqual(biz.RowNumber, 2) 
    184184 
     185         
    185186    def test_isChanged(self): 
    186187        biz = self.biz 
     
    409410        self.assertEqual(bizMain.RowNumber, 3) 
    410411 
     412 
     413    def testChildren_cancel(self): 
     414        bizMain = self.biz 
     415        bizChild = dabo.biz.dBizobj(self.con) 
     416        bizChild.UserSQL = "select * from %s" % self.temp_child_table_name 
     417        bizChild.KeyField = "pk" 
     418        bizChild.DataSource = self.temp_child_table_name 
     419        bizChild.LinkField = "parent_fk" 
     420        bizChild.FillLinkFromParent = True 
     421         
     422        bizMain.addChild(bizChild) 
     423        bizMain.requery() 
     424 
     425        # Test the case where you add a new child record, then cancel the parent: 
     426        self.assertEqual(bizChild.RowCount, 2) 
     427        bizChild.new() 
     428        self.assertEqual(bizChild.RowCount, 3) 
     429        bizMain.cancel() 
     430        self.assertEqual(bizChild.RowCount, 2) 
     431             
     432 
    411433    def testNullRecord(self): 
    412434        biz = self.biz