Projet

Général

Profil

0001-tests-add-full-string-de-serialization-to-import-exp.patch

Nicolas Roche, 29 août 2019 16:42

Télécharger (1,53 ko)

Voir les différences:

Subject: [PATCH 1/4] tests: add full string (de)serialization to import/export
 tests (#31823)

 tests/test_formdef_import.py  | 2 +-
 tests/test_workflow_import.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
tests/test_formdef_import.py
28 28
    shutil.rmtree(pub.APP_DIR)
29 29

  
30 30
def export_to_indented_xml(formdef, include_id=False):
31
    formdef_xml = formdef.export_to_xml(include_id=include_id)
31
    formdef_xml = ET.fromstring(ET.tostring(formdef.export_to_xml(include_id=include_id)))
32 32
    indent(formdef_xml)
33 33
    return formdef_xml
34 34

  
tests/test_workflow_import.py
38 38
    return workflow_xml
39 39

  
40 40
def assert_import_export_works(wf, include_id=False):
41
    wf2 = Workflow.import_from_xml_tree(wf.export_to_xml(include_id), include_id)
41
    wf2 = Workflow.import_from_xml_tree(
42
        ET.fromstring(ET.tostring(wf.export_to_xml(include_id))), include_id)
42 43
    assert ET.tostring(export_to_indented_xml(wf)) == ET.tostring(export_to_indented_xml(wf2))
43 44
    return wf2
44 45

  
45
-