def test_unicode(self): s = u'\x34\x55\x65\x34' self.assertEquals(4, len(s)) element = etree.Element('test') String.to_xml(s, 'test_ns', element) element = element[0] value = String.from_xml(element) self.assertEquals(value, s)
def test_string(self): s = String() element = etree.Element('test') String.to_xml('value', ns_test, element) element=element[0] self.assertEquals(element.text, 'value') value = String.from_xml(element) self.assertEquals(value, 'value')
def test_string(self): s = String() element = etree.Element('test') String.to_xml('value', ns_test, element) element = element[0] self.assertEquals(element.text, 'value') value = String.from_xml(element) self.assertEquals(value, 'value')
class NonNillableClass(ClassSerializer): __namespace__ = "hunk.sunk" nillable = False min_occurs = 1 dt = DateTime(min_occurs=1, nillable=False) i = Integer(nillable=False) s = String(min_len=1, nillable=False)