Ejemplo n.º 1
0
 def test_empty(self):
     from htmlpp.nodes import _Root
     ast = _Root("", {}, [])
     render = self._callFUT(ast)
     context = {}
     result = render(context)
     self.assertEqual(result.strip(), "")
Ejemplo n.º 2
0
    def test_empty(self):
        from htmlpp.nodes import _Root

        ast = _Root("", {}, [])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assertEqual(result.strip(), "")
Ejemplo n.º 3
0
    def test_rawhtml(self):
        from htmlpp.nodes import _Root
        text = """
<!DOCTYPE html>
<html>
{% include "foo.bar.html" %}
{% for line in body%}
  <p>{{line}}</p>
{% endfor %}
</html>
"""
        ast = _Root(text, {}, [text])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assert_normalized(result, text)
Ejemplo n.º 4
0
    def test_rawhtml(self):
        from htmlpp.nodes import _Root

        text = """
<!DOCTYPE html>
<html>
{% include "foo.bar.html" %}
{% for line in body%}
  <p>{{line}}</p>
{% endfor %}
</html>
"""
        ast = _Root(text, {}, [text])
        render = self._callFUT(ast)
        context = {}
        result = render(context)
        self.assert_normalized(result, text)