'When a NICK command is sent after signon, C{IRCClient.nickname} is set
to the new nickname I{after} the server sends an acknowledgement.'

def test_nickChange(self):

    oldnick = 'foo'
    newnick = 'bar'
    self.protocol.register(oldnick)
    self.protocol.irc_RPL_WELCOME('prefix', ['param'])
    self.protocol.setNick(newnick)
    self.assertEqual(self.protocol.nickname, oldnick)
    self.protocol.irc_NICK(('%s!quux@qux' % (oldnick,)), [newnick])
    self.assertEqual(self.protocol.nickname, newnick)
