Update tostring methods.

Will now always show top-level namespace, unless it is the same
as the stream's default namespace. Also added the XMPP stream
namespace to the namespace map as 'stream'.
This commit is contained in:
Lance Stout
2011-01-27 18:05:05 -05:00
parent cd800d636a
commit bd9bf3f1c7
5 changed files with 43 additions and 15 deletions

View File

@@ -102,11 +102,13 @@ class TestToString(SleekTest):
"""
Test that stanza objects are serialized properly.
"""
self.stream_start()
utf8_message = '\xe0\xb2\xa0_\xe0\xb2\xa0'
if not hasattr(utf8_message, 'decode'):
# Python 3
utf8_message = bytes(utf8_message, encoding='utf-8')
msg = Message()
msg = self.Message()
msg['body'] = utf8_message.decode('utf-8')
expected = '<message><body>\xe0\xb2\xa0_\xe0\xb2\xa0</body></message>'
result = msg.__str__()