I created a wizard (see below) and added a test scenario for it. The wizard shows a form, imports some data (state import_
) and shows a result summary (state result
).
Now this simple test fails:
>>> importer = Wizard('importwizard.tests.import.test')
>>> importer.execute('import_')
>>> assert importer.state == 'result'
importer.state
is still import_
, while I would expect it to be result
.
Anyhow there is importer.from_state
, which contains the expected value result
.
Why is the state
not result
, too? Is this a bug to report?
class MyImportWizard(Wizard):
'''Stripped down example wizard'''
__name__ = 'importwizard.tests.import.test'
start = StateView(…, …, [
Button("Import", 'import_', 'tryton-ok'),
])
import_ = StateTransition()
result = StateView(…, …, [
Button("Close", 'end', 'tryton-close'),
])
def transition_import_(self):
so_something()
return 'result'