Browse Source

Issue #55: Added tests to reproduce the raw tag issue in vain

main
Lakshmi Vyasarajan 13 years ago
parent
commit
5fa1ded595
1 changed files with 37 additions and 0 deletions
  1. +37
    -0
      hyde/tests/test_jinja2template.py

+ 37
- 0
hyde/tests/test_jinja2template.py View File

@@ -597,3 +597,40 @@ item_list:
assert items == ["A", "B", "C"] assert items == ["A", "B", "C"]
items = [item.text for item in actual("ul.mid li")] items = [item.text for item in actual("ul.mid li")]
assert items == ["D", "E", "F"] assert items == ["D", "E", "F"]

def test_raw_tag(self):
expected = """
<div class="template secondary">
<aside class="secondary">
<ul>
{{#sections}}
<li><a href="#{{id}}">{{textContent}}</a></li>
{{/sections}}
</ul>
</aside>
"""
text = "{%% raw %%}%s{%% endraw %%}" % expected
t = Jinja2Template(JINJA2.path)
t.configure(None)
html = t.render(text, {}).strip()
assert html.strip() == expected.strip()

def test_raw_tag_with_markdown_typogrify(self):
expected = """
<div class="template secondary">
<aside class="secondary">
<ul>
{{#sections}}
<li><a href="#{{id}}">{{textContent}}</a></li>
{{/sections}}
</ul>
</aside>
"""
text = "{%% filter markdown|typogrify %%}{%% raw %%}%s{%% endraw %%}{%% endfilter %%}" % expected
t = Jinja2Template(JINJA2.path)
t.configure(None)
html = t.render(text, {}).strip()
assert html.strip() == expected.strip()




Loading…
Cancel
Save