'L{DigestCredentialFactory.decode} raises L{LoginFailed} if the response
has no username field or if the username field is empty.'

def test_noUsername(self):

    e = self.assertRaises(LoginFailed, self.credentialFactory.decode, self.formatResponse(username=None), self.method, self.clientAddress.host)
    self.assertEqual(str(e), 'Invalid    response,    no    username    given.')
    e = self.assertRaises(LoginFailed, self.credentialFactory.decode, self.formatResponse(username=''), self.method, self.clientAddress.host)
    self.assertEqual(str(e), 'Invalid    response,    no    username    given.')
