def test_nick(self):
        newNick = 'newNick'

        room = self._createRoom()

        def joined(room):
            self.assertEqual(self.roomJID, room.roomJID)
            self.assertEqual(newNick, room.nick)
            user = room.getUser(newNick)
            self.assertNotIdentical(None, user)
            self.assertEqual(newNick, user.nick)

        d = self.protocol.nick(self.roomJID, newNick)
        d.addCallback(joined)

        # Nick should not have been changed, yet, as we haven't gotten
        # confirmation, yet.

        self.assertEquals(self.nick, room.nick)

        # send back user presence, nick changed
        xml = u"""
            <presence from='%s/%s'>
              <x xmlns='http://jabber.org/protocol/muc#user'>
                <item affiliation='member' role='participant'/>
              </x>
            </presence>
        """ % (self.roomJID, newNick)

        self.stub.send(parseXml(xml))
        return d
Send a nick change to the server.
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_muc.py/MUCClientTest.test_nick