Test wizard button points to existing state

issue8901
review282511002
This commit is contained in:
Cédric Krier committed 2019-12-14 10:44:55 +01:00
1 parent 0ff927977d
commit 6250b08db5
1 file changed
+12 -1
+12 -1
View File
@@ -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()