'Test that stanza objects are serialized properly.'

def testStanzaStr(self):

    self.stream_start()
    utf8_message = '\xe0\xb2\xa0_\xe0\xb2\xa0'
    if (not hasattr(utf8_message, 'decode')):
        utf8_message = bytes(utf8_message, encoding='utf-8')
    msg = self.Message()
    msg['body'] = utf8_message.decode('utf-8')
    expected = '<message><body>\xe0\xb2\xa0_\xe0\xb2\xa0</body></message>'
    result = msg.__str__()
    self.failUnless((result == expected), ('Stanza    Unicode    handling    is    incorrect:    %s' % result))
