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 <')
Esempio n. 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 <'
Esempio n. 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 <'
Esempio n. 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 <')