def setup_view(view, request, *args, **kwargs):
    view.request = request
    view.args = args
    view.kwargs = kwargs
    return view
Mimic as_view() returned callable, but returns view instance
dataset/ETHPy150Open CenterForOpenScience/osf.io/admin_tests/utilities.py/setup_view