changeset 8d02462e6dcc in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=8d02462e6dcc
description:
        Test wizard button points to existing state

        issue8901
        review282511002
diffstat:

 trytond/tests/test_tryton.py |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 9149871fdc8d -r 8d02462e6dcc trytond/tests/test_tryton.py
--- a/trytond/tests/test_tryton.py      Wed Dec 11 22:25:51 2019 +0100
+++ b/trytond/tests/test_tryton.py      Sat Dec 14 10:44:55 2019 +0100
@@ -527,7 +527,18 @@
                 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()
 

Reply via email to