Example #1
0
 def test_no_child(self):
     """ rendering a base template with slot without a child providing
         a fill """
     tpl = "1\n\n{% slot %}hello{%endslot%}"
     res = Template(tpl).render()
     assert res == "1\n\nhello"
Example #2
0
 def test_explicit1(self):
     base = Template("HEAD {%slot main%}xxx{%endslot%} FOOTER")
     final = Template("This is the body", parent=base)
     res = final.render()
     assert res == "HEAD This is the body FOOTER"
Example #3
0
 def test_attraction_marker(self):
     base = Template("HEAD {% slot content %}xxx{% endslot %} FOOTER")
     final = Template("<<MARKER>>", parent=base)
     res = final.render()
     assert res == "HEAD <<MARKER>> FOOTER"