tests: add full string (de)serialization to import/export tests (#31823)
This commit is contained in:
parent
d0842a5729
commit
a86a837bb4
|
@ -28,7 +28,7 @@ def teardown_module(module):
|
|||
shutil.rmtree(pub.APP_DIR)
|
||||
|
||||
def export_to_indented_xml(formdef, include_id=False):
|
||||
formdef_xml = formdef.export_to_xml(include_id=include_id)
|
||||
formdef_xml = ET.fromstring(ET.tostring(formdef.export_to_xml(include_id=include_id)))
|
||||
indent(formdef_xml)
|
||||
return formdef_xml
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@ def export_to_indented_xml(workflow, include_id=False):
|
|||
return workflow_xml
|
||||
|
||||
def assert_import_export_works(wf, include_id=False):
|
||||
wf2 = Workflow.import_from_xml_tree(wf.export_to_xml(include_id), include_id)
|
||||
wf2 = Workflow.import_from_xml_tree(
|
||||
ET.fromstring(ET.tostring(wf.export_to_xml(include_id))), include_id)
|
||||
assert ET.tostring(export_to_indented_xml(wf)) == ET.tostring(export_to_indented_xml(wf2))
|
||||
return wf2
|
||||
|
||||
|
|
Loading…
Reference in New Issue