Changeset 3202

Show
Ignore:
Timestamp:
06/22/07 12:36:45 (2 years ago)
Author:
paul
Message:

Added a test for John and Larry's case, which proves that Dabo isn't doing this
correctly. The test requeries bizMain() to 0 records, but bizChild still has
its original 2 records.

Files:

Legend:

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

    r3069 r3202  
    431431             
    432432 
     433    def testChildren_clearParent(self): 
     434        """Requerying bizMain to 0 records should remove bizChild's records, too.""" 
     435        bizMain = self.biz 
     436        bizChild = dabo.biz.dBizobj(self.con) 
     437        bizChild.UserSQL = "select * from %s" % self.temp_child_table_name 
     438        bizChild.KeyField = "pk" 
     439        bizChild.DataSource = self.temp_child_table_name 
     440        bizChild.LinkField = "parent_fk" 
     441        bizChild.FillLinkFromParent = True 
     442         
     443        bizMain.addChild(bizChild) 
     444        bizMain.requery() 
     445 
     446        bizMain.UserSQL = "select * from %s where 1=0" % self.temp_table_name 
     447        bizMain.requery() 
     448        self.assertEqual(bizMain.RowCount, 0) 
     449        self.assertEqual(bizChild.RowCount, 0) 
     450     
    433451    def testNullRecord(self): 
    434452        biz = self.biz