'L{DigestCredentialFactory.decode} accepts a digest challenge response
and parses it into an L{IUsernameHashedPassword} provider.'

def test_response(self, quotes=True):

    challenge = self.credentialFactory.getChallenge(self.clientAddress.host)
    nc = '00000001'
    clientResponse = self.formatResponse(quotes=quotes, nonce=challenge['nonce'], response=self.getDigestResponse(challenge, nc), nc=nc, opaque=challenge['opaque'])
    creds = self.credentialFactory.decode(clientResponse, self.method, self.clientAddress.host)
    self.assertTrue(creds.checkPassword(self.password))
    self.assertFalse(creds.checkPassword((self.password + 'wrong')))
