def setup_form_view(view, request, form, *args, **kwargs):
 view.request = request
 try:
  view.request.user = request.user
 except AttributeError:
  view.request.user = UserFactory()
 view.args = args
 view.kwargs = kwargs
 view.form = form
 return view

def setup_form_view ( view , request , form , * args , ** kwargs ) : view . request = request try : view . request . user = request . user except AttributeError : view . request . user = UserFactory ( ) view . args = args view . kwargs = kwargs view . form = form return view
mimic as_view and with forms to skip some of the context .