def monkeypatch_render():
 import django.shortcuts
 def more_info(fun):
  "Django's render shortcut, but captures information for testing\n        When using Django's render shortcut with Jinja2 templates, none of\n        the information is captured and thus you can't use it for testing.\n        This alleviates that somewhat by capturing some of the information\n        allowing you to test it.\n        Caveats:\n        * it does *not* capture all the Jinja2 templates used to render.\n        Only the topmost one requested by the render() function.\n        "
  @wraps(fun)
  def _more_info(request, template_name, *args, **kwargs):
   resp = fun(request, template_name, *args, **kwargs)
   resp.jinja_templates = [template_name]
   if args:
    resp.jinja_context = args[0]
   elif ('context' in kwargs):
    resp.jinja_context = kwargs['context']
   else:
    resp.jinja_context = {}
   return resp
  return _more_info
 django.shortcuts.render = more_info(django.shortcuts.render)

def monkeypatch_render ( ) : import django . shortcuts def more_info ( fun ) : @ wraps ( fun ) def _more_info ( request , template_name , * args , ** kwargs ) : resp = fun ( request , template_name , * args , ** kwargs ) resp . jinja_templates = [ template_name ] if args : resp . jinja_context = args [ 0 ] elif ( 'context' in kwargs ) : resp . jinja_context = kwargs [ 'context' ] else : resp . jinja_context = { } return resp return _more_info django . shortcuts . render = more_info ( django . shortcuts . render )
monkeypatches django .