def setup_form_view(view, request, form, *args, **kwargs):
    """Mimic as_view and with forms to skip some of the context"""
    view.request = request
    try:
        view.request.user = request.user
    except __HOLE__:
        view.request.user = UserFactory()
    view.args = args
    view.kwargs = kwargs
    view.form = form
    return view
dataset/ETHPy150Open CenterForOpenScience/osf.io/admin_tests/utilities.py/setup_form_view