'Test that JIDs with Unicode values are handled properly.'

def testRosterUnicode(self):

    self.stream_start(plugins=[])
    self.recv(u'\n                                        <iq    to="tester@localhost"    type="set"    id="1">\n                                                <query    xmlns="jabber:iq:roster">\n                                                        <item    jid="andr\xe9@foo"    subscription="both">\n                                                                <group>Unicode</group>\n                                                        </item>\n                                                </query>\n                                        </iq>\n                                ')
    time.sleep(0.1)
    self.check_roster(u'tester@localhost', u'andr\xe9@foo', subscription=u'both', groups=[u'Unicode'])
    jids = list(self.xmpp.client_roster.keys())
    self.failUnless((jids == [u'andr\xe9@foo']), (u'Too    many    roster    entries    found:    %s' % jids))
    self.recv(u'\n                                        <presence    to="tester@localhost"    from="andr\xe9@foo/bar">\n                                                <show>away</show>\n                                                <status>Testing</status>\n                                        </presence>\n                                ')
    time.sleep(0.1)
    result = self.xmpp.client_roster[u'andr\xe9@foo'].resources
    expected = {u'bar': {u'status': u'Testing', u'show': u'away', u'priority': 0}}
    self.failUnless((result == expected), (u'Unexpected    roster    values:    %s' % result))
