'Test initializer failure of request for fields for authentication.'

def testFailRequestFields(self):

    def onAuthGet(iq):
        '\n                                                Called    when    the    initializer    sent    a    query    for    authentication    methods.\n\n                                                The    server    responds    that    the    client    is    not    authorized    to    authenticate.\n                                                '
        response = error.StanzaError('not-authorized').toResponse(iq)
        self.pipe.source.send(response)
    d1 = self.waitFor(IQ_AUTH_GET, onAuthGet)
    d2 = self.init.initialize()
    self.assertFailure(d2, error.StanzaError)
    return defer.gatherResults([d1, d2])
