def patch_mako_templates():
 orig_render = Template.render_unicode
 def wrapped_render(*args, **kwargs):
  ' Render the template and send the context info to any listeners that want it '
  django.test.signals.template_rendered.send(sender=None, template=None, context=kwargs)
  return orig_render(*args, **kwargs)
 return mock.patch.multiple(Template, render_unicode=wrapped_render, render=wrapped_render)

def patch_mako_templates ( ) : orig_render = Template . render_unicode def wrapped_render ( * args , ** kwargs ) : django . test . signals . template_rendered . send ( sender = None , template = None , context = kwargs ) return orig_render ( * args , ** kwargs ) return mock . patch . multiple ( Template , render_unicode = wrapped_render , render = wrapped_render )
patch mako so the django test client can access template context .