Reproduce a bug with unset attributes serialisation to xml

This commit is contained in:
Christophe de Vienne
2012-05-18 11:56:41 +02:00
parent 4c798215c9
commit 6ead929ca4

View File

@@ -175,6 +175,15 @@ class TestRestXML(wsme.tests.protocol.ProtocolTestCase):
x = et.tostring(toxml(dt, 'value', None))
assert x == b('<value nil="true" />'), x
def test_unset_attrs(self):
class AType(object):
someattr = wsme.types.bytes
wsme.types.register_type(AType)
x = et.tostring(toxml(AType, 'value', AType()))
assert x == b('<value />'), x
def test_parse_arg(self):
e = self.root.protocols[0].parse_arg('value', '5')
assert e.text == '5'