#NEWLINE# def test_incompatibleNonce( self ) : #NEWLINE# #INDENT# '\n        L{DigestCredentialFactory.decode} raises L{LoginFailed} when the given\n        nonce from the response does not match the nonce encoded in the opaque.\n        ' #NEWLINE# credentialFactory = FakeDigestCredentialFactory ( self . algorithm , self . realm ) #NEWLINE# challenge = credentialFactory . getChallenge ( self . clientAddress . host ) #NEWLINE# badNonceOpaque = credentialFactory . _generateOpaque ( '1234567890' , self . clientAddress . host ) #NEWLINE# exc = self . assertRaises ( LoginFailed , credentialFactory . _verifyOpaque , badNonceOpaque , challenge [ 'nonce' ] , self . clientAddress . host ) #NEWLINE# self . assertEqual ( str ( exc ) , 'Invalid response, incompatible opaque/nonce values' ) #NEWLINE# exc = self . assertRaises ( LoginFailed , credentialFactory . _verifyOpaque , badNonceOpaque , '' , self . clientAddress . host ) #NEWLINE# self . assertEqual ( str ( exc ) , 'Invalid response, incompatible opaque/nonce values' )