Пример #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
 def _render(template, context, app):
     app.update_template_context(context)
     rv = template.render(**context)
     template_rendered.send(app, template=template, context=context)
     return rv