2016-08-25 10:22 GMT+02:00 Sergi Almacellas Abellana <se...@koolpi.com>:
> El 25/08/16 a les 10:02, Jesús Martín Jiménez ha escrit: > >> Hi, >> >> I'm testing a customized module and I run into an issue I'm not sure how >> to resolve. My module has an extras_depend of stock_lot and an on_change >> method for lot field. It works well, but when I try to pass the unittest >> test, it fails with this traceback [1]. I'm not sure if it is a bug or >> the desired behavior. >> > > For me is the expected behavior if you define the on_change_lot method > when the stock_lot module is not installed. > > That can be solved by defining the on_change only if the stock_lot module > is installed, which can be done on the __setup__ method of the class. > I think it's better to raise a warning instead of an assert exception for this test. To have an unused method is not an error/crash. For example, pylint defines the "unused param/variable/import" as a warning, not an error. -- Guillem Barba http://www.guillem.alcarrer.net -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/CAMgcrAzX%2BtCMbziMZB7K2RZo_bqMLs%2B6jde-Hj9D3a067rxRzw%40mail.gmail.com.