def test_authenticatedLoginWithMultipleCheckers(self):
        """
        Like L{test_anonymousLoginWithMultipleCheckers} but check that
        username/password authentication works.
        """
        self.portal.registerChecker(checkers.AllowAnonymousAccess())
        self.portal.registerChecker(
            checkers.InMemoryUsernamePasswordDatabaseDontUse(user=b'pass'))
        d = self.clientFactory.login(
            credentials.UsernamePassword(b'user', b'pass'), "BRAINS!")

        def cbLogin(perspective):
            return perspective.callRemote('add', 100, 23)
        d.addCallback(cbLogin)

        d.addCallback(self.assertEqual, 123)

        self.establishClientAndServer()
        self.pump.flush()

        return d

        Like L{test_anonymousLoginWithMultipleCheckers} but check that
        username/password authentication works.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py