From 6250b08db51d3cae1b32dcc28faaf790f372c8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 14 Dec 2019 10:44:55 +0100 Subject: [PATCH] Test wizard button points to existing state issue8901 review282511002 --- trytond/tests/test_tryton.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/trytond/tests/test_tryton.py b/trytond/tests/test_tryton.py index 9301ca6850..60e1ba7214 100644 --- a/trytond/tests/test_tryton.py +++ b/trytond/tests/test_tryton.py @@ -527,7 +527,18 @@ class ModuleTestCase(unittest.TestCase): if isinstance(state, StateView): # Don't test defaults as they may depend on context state.get_view(wizard_instance, state_name) - state.get_buttons(wizard_instance, state_name) + for button in state.get_buttons( + wizard_instance, state_name): + if button['state'] == wizard.end_state: + continue + self.assertIn( + button['state'], + wizard_instance.states.keys(), + msg='Unknown button state from "%(state)s" ' + 'on wizard "%(wizard)s' % { + 'state': state_name, + 'wizard': wizard_name, + }) if isinstance(state, StateAction): state.get_action()