From 6ead929ca496ea5e568954aea841150dfb1b6004 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Fri, 18 May 2012 11:56:41 +0200 Subject: [PATCH] Reproduce a bug with unset attributes serialisation to xml --- wsme/tests/test_restxml.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wsme/tests/test_restxml.py b/wsme/tests/test_restxml.py index b30f2bd..f51c257 100644 --- a/wsme/tests/test_restxml.py +++ b/wsme/tests/test_restxml.py @@ -175,6 +175,15 @@ class TestRestXML(wsme.tests.protocol.ProtocolTestCase): x = et.tostring(toxml(dt, 'value', None)) assert x == b(''), 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(''), x + def test_parse_arg(self): e = self.root.protocols[0].parse_arg('value', '5') assert e.text == '5'