diff --git a/trytond/trytond/tests/test_tryton.py b/trytond/trytond/tests/test_tryton.py index 16b877f015..15d8e3a955 100644 --- a/trytond/trytond/tests/test_tryton.py +++ b/trytond/trytond/tests/test_tryton.py @@ -1104,6 +1104,20 @@ class ModuleTestCase(_DBTestCase): 'keys': set(states) - keys, }) + @with_transaction() + def test_button_methods(self): + "Test button methods without records" + for mname, model in Pool().iterobject(): + if not isregisteredby(model, self.module): + continue + if not issubclass(model, ModelView): + continue + for button in model._buttons: + if is_instance_method(model, button): + getattr(model(), button)() + else: + getattr(model, button)([]) + @with_transaction() def test_xml_files(self): "Test validity of the xml files of the module"