Commit 16a7f7be authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[test] Test the case of XSD generation using intermediary type

e.g. for union of date and dateTime types.
parent 1c9076d1878c
......@@ -401,6 +401,16 @@ class SEDAXSDExportFuncTC(XmlTestMixin, CubicWebTC):
'//xs:element[@name="Keyword"]'
'//xs:attribute[@name="id" and @use="optional"]')
self.assertEqual(len(references), 1)
# ensure custodial item content type is properly serialized
chi = self.xpath(profile, '//xs:element[@name="CustodialHistoryItem"]')
self.assertEqual(len(chi), 1)
self.assertXSDAttributes(
chi[0],
[{'name': 'when', 'use': 'optional', 'type': 'datedateTime'}])
ddt = self.xpath(profile, '//xs:simpleType[@name="datedateTime"]')
self.assertEqual(len(ddt), 1)
self.assertEqual(ddt[0][0].tag, '{http://www.w3.org/2001/XMLSchema}union')
self.assertEqual(ddt[0][0].attrib, {'memberTypes': 'xsd:date xsd:dateTime'})
if __name__ == '__main__':
......
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