コード例 #1
0
def test_no_jinja_autoescape():
    val = 'some double quote: " and a <'
    tpl = '{{ val }}'
    ctx = {'val': val}
    template = jingo.env.from_string(tpl)
    eq_(template.render(ctx), 'some double quote: &#34; and a &lt;')
    with no_jinja_autoescape():
        template = jingo.env.from_string(tpl)
        eq_(template.render(ctx), 'some double quote: " and a <')
コード例 #2
0
def test_no_jinja_autoescape():
    val = 'some double quote: " and a <'
    tpl = '{{ val }}'
    ctx = {'val': val}
    template = from_string(tpl)
    assert template.render(ctx) == 'some double quote: &#34; and a &lt;'
    with no_jinja_autoescape():
        template = from_string(tpl)
        assert template.render(ctx) == 'some double quote: " and a <'
コード例 #3
0
def test_no_jinja_autoescape():
    val = 'some double quote: " and a <'
    tpl = '{{ val }}'
    ctx = {'val': val}
    template = from_string(tpl)
    assert template.render(ctx) == 'some double quote: &#34; and a &lt;'
    with no_jinja_autoescape():
        template = from_string(tpl)
        assert template.render(ctx) == 'some double quote: " and a <'
コード例 #4
0
def test_no_jinja_autoescape():
    val = 'some double quote: " and a <'
    tpl = '{{ val }}'
    ctx = {'val': val}
    template = jingo.env.from_string(tpl)
    eq_(template.render(ctx), 'some double quote: &#34; and a &lt;')
    with no_jinja_autoescape():
        template = jingo.env.from_string(tpl)
        eq_(template.render(ctx), 'some double quote: " and a <')