'Reconfigure the server to disallow anonymous access, and to have an
IUsernamePassword checker that always rejects.
@return: L{Deferred} of command response'

def test_AnonymousLoginDenied(self):

    self.factory.allowAnonymous = False
    denyAlwaysChecker = checkers.InMemoryUsernamePasswordDatabaseDontUse()
    self.factory.portal.registerChecker(denyAlwaysChecker, credentials.IUsernamePassword)
    d = self.assertCommandResponse('USER    anonymous', ['331    Password    required    for    anonymous.'])
    d = self.assertCommandFailed('PASS    test@twistedmatrix.com', ['530    Sorry,    Authentication    failed.'], chainDeferred=d)
    d = self.assertCommandFailed('PWD', ['530    Please    login    with    USER    and    PASS.'], chainDeferred=d)
    return d
