def test_nick(self):
        newNick = 'newNick'

        def cb(presence):
            self.assertEquals(JID(tuple=(self.roomIdentifier,
                                         self.service,
                                         newNick)),
                              presence.sender)

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

        element = self.stub.output[-1]
        self.assertEquals('presence', element.name, "Need to be presence")
        self.assertNotIdentical(None, element.x, 'No muc x element')

        # 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/MUCClientProtocolTest.test_nick