Commit 9cabec51 authored by Jérome Perrin's avatar Jérome Perrin

configurator_standard: fix FakeFormBoxEditor in test

as_dict is supposed to return an actual dict, not a FakeFormBoxEditor
that might not be pickleable
parent b2e93a3f
...@@ -33,15 +33,7 @@ from DateTime import DateTime ...@@ -33,15 +33,7 @@ from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from erp5.component.module.ConfiguratorTestMixin import \ from erp5.component.module.ConfiguratorTestMixin import \
TestLiveConfiguratorWorkflowMixin TestLiveConfiguratorWorkflowMixin
from Products.ERP5Form.FormBox import FormBoxEditor
class FakeFormBoxEditor(dict):
"""Quick replacement for formbox editor.
"""
__allow_access_to_unprotected_subobjects__ = 1
def as_dict(self):
return self
class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
...@@ -1169,6 +1161,16 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1169,6 +1161,16 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
], ],
) )
form_box_editor = FormBoxEditor(
result=(
{
# this is what GenericSolver_viewConfigurationFormBox/my_tested_property_list passes as default hidden
'tested_property_list': solver_decision.getCausalityValue().getTestedPropertyList(),
},
[],
),
context=None,
)
listbox = ( listbox = (
{ {
'listbox_key': 'listbox_key':
...@@ -1177,9 +1179,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1177,9 +1179,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
'portal_solvers/Accept Solver', 'portal_solvers/Accept Solver',
# this is what GenericSolver_viewConfigurationFormBox/my_tested_property_list passes as default hidden # this is what GenericSolver_viewConfigurationFormBox/my_tested_property_list passes as default hidden
'solver_configuration': 'solver_configuration':
FakeFormBoxEditor( form_box_editor,
tested_property_list=solver_decision.getCausalityValue()
.getTestedPropertyList()),
'comment': 'comment':
'', '',
},) },)
...@@ -1607,17 +1607,24 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -1607,17 +1607,24 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
], ],
) )
form_box_editor = FormBoxEditor(
result=(
{
# this is what GenericSolver_viewConfigurationFormBox/my_tested_property_list passes as default hidden
'tested_property_list': solver_decision.getCausalityValue().getTestedPropertyList(),
},
[],
),
context=None,
)
listbox = ( listbox = (
{ {
'listbox_key': 'listbox_key':
solver_decision.getPath(), solver_decision.getPath(),
'solver': 'solver':
'portal_solvers/Accept Solver', 'portal_solvers/Accept Solver',
# this is what GenericSolver_viewConfigurationFormBox/my_tested_property_list passes as default hidden
'solver_configuration': 'solver_configuration':
FakeFormBoxEditor( form_box_editor,
tested_property_list=solver_decision.getCausalityValue()
.getTestedPropertyList()),
'comment': 'comment':
'', '',
},) },)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment