def setup_log_view(view, request, *args, **kwargs):
    view.request = request
    try:
        view.request.user = request.user
    except __HOLE__:
        view.request.user = UserFactory()
    view.args = args
    view.kwargs = kwargs
    return view
dataset/ETHPy150Open CenterForOpenScience/osf.io/admin_tests/utilities.py/setup_log_view