On 07/03/2011 18:59, Paul McNett wrote:
> On 3/7/11 7:34 AM, Werner F. Bruhin wrote:
>> The test code for e.g. a grid is this:
>>
>> if __name__ == "__main__":
>>        from FrmCountry_Ls import FrmCountry_Ls
>>        app = dabo.dApp(MainFormClass=None)
>>        app.setup()
>>
>>        class TestForm(FrmCountry_Ls):
>>            def afterInit(self): pass
>>        frm = TestForm(Caption="Test Of GrdCountry_Ls", Testing=True)
>>        test = GrdCountry_Ls(frm)
>>        frm.Sizer.append1x(test)
>>        frm.show()
>>        app.start()
>>
>> Which doesn't work with my recent change for getCaption and friends,
>> i.e. this
>>        def afterInitAll(self):
>>            self.super()
>>            biz = self.Form.getBizobj("COUNTRY_LS")
>>
>> returns "None" in biz.
>>
>> What do I need to set in the above test code that getBizobj will get the
>> right thing.
> When testing, a bizobj is unnecessary overhead. afterInitAll() should be:
>
> def afterInitAll(self):
>       self.super()
>       biz = self.Form.getBizobj("COUNTRY_LS")
>       if not biz:
>               # testing
>               return
>       ...
>
Did it slightly differently, i.e. fake a minimal bizobj so that the 
grid, edit and select forms can be created.

See commit 6493, hope this is fine.

Werner

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

Reply via email to