import functools


def authenticated_test(f):
    """Swaps out the client for an authenticated client."""
    @functools.wraps(f)
    def wrapped_test(self):
        with self.swapClient(self.authenticated_client):
            return f(self)
    return wrapped_test