Open dalepotter opened 6 years ago
err-not-iati-xml-missing-required-element
is created based on the lxml error SCHEMAV_ELEMENT_CONTENT
.
The current test for this error related only to missing elements. I would expect that mis-ordered elements will also cause this error, though it is not tested - this seems to be something that should be added.
The description
and help
attributes should provide useful information, with info
being there for completeness sake. This may feed into #231.
In our work to use pyIATI in the test runner for the v2.03 IATI schema work, we test that failing files fail for an expected reason.
The failing file here tests that an non-permitted child element fails schema validation. This creates the following
iati.validator.ValidationError
object:The generated error
err-not-iati-xml-missing-required-element
seems unintuitive given that theinfo
attribute statesElement 'unexpected-element': This element is not expected. Expected is ( ##other* ).
.Is ti worth adding a new mapping to this to generate a new error, for example
err-not-iati-xml-unexpected-element
?