예제 #1
0
def _empty_render(template, context, app):
    """
    Used to monkey patch the render_template flask method when
    the render_templates property is set to False in the TestCase
    """
    if _is_signals:
        template_rendered.send(app, template=template, context=context)

    return ""
예제 #2
0
def _empty_render(template, context, app):
    """
    Used to monkey patch the render_template flask method when
    the render_templates property is set to False in the TestCase
    """
    if _is_signals:
        template_rendered.send(app, template=template, context=context)

    return ""
예제 #3
0
def _render(renderer, context, app):
    """Renders the template and fires the signal"""

    _renderer = locate(renderer)
    if not _renderer:
        raise RendererNotFound(renderer)

    _context = dict(app.jinja_env.globals, **context)
    before_render_template.send(app, template=renderer, context=_context)
    rv = _renderer(_context)
    template_rendered.send(app, template=renderer, context=_context)
    return rv
예제 #4
0
 def _empty_render(template, context, app):
     template_rendered.send(app, template=template, context=context)
     return ""
예제 #5
0
파일: monkey.py 프로젝트: rfw/navigr8
 def _render(template, context, app):
     app.update_template_context(context)
     rv = template.render(**context)
     template_rendered.send(app, template=template, context=context)
     return rv