Commit 12f56953 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[test] extract file read out of call of assertXmlEqual()

parent 97f0cc843868
......@@ -932,19 +932,20 @@ class OldSEDAExportMixin(object):
root = etree.fromstring(generated_xsd)
self.assertXmlValid(root)
with open(self.datapath(expected_file)) as expected:
self.assertXmlEqual(expected.read()
% {'unit-eid': binary_type(self.unit_eid),
'subunit1-eid': binary_type(self.subunit1_eid),
'subunit2-eid': binary_type(self.subunit2_eid),
'bdo-eid': binary_type(self.bdo_eid),
'kw-eid': binary_type(self.kw_eid),
'chi-eid': binary_type(self.chi_eid),
'concept-uri': binary_type(file_concept.cwuri),
'scheme-uri': binary_type(file_concept.scheme.cwuri),
'agent-id': binary_type(agent.eid),
'agent-name': binary_type(agent.dc_title())},
generated_xsd)
with open(self.datapath(expected_file)) as f:
expected = f.read() % {
'unit-eid': binary_type(self.unit_eid),
'subunit1-eid': binary_type(self.subunit1_eid),
'subunit2-eid': binary_type(self.subunit2_eid),
'bdo-eid': binary_type(self.bdo_eid),
'kw-eid': binary_type(self.kw_eid),
'chi-eid': binary_type(self.chi_eid),
'concept-uri': binary_type(file_concept.cwuri),
'scheme-uri': binary_type(file_concept.scheme.cwuri),
'agent-id': binary_type(agent.eid),
'agent-name': binary_type(agent.dc_title()),
}
self.assertXmlEqual(expected, generated_xsd)
return adapter, root
......
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