'Tests the {% render_placeholder %} templatetag.'

def test_render_placeholder_tag(self):

    render_placeholder_body = "I'm    the    render    placeholder    body"
    ex1 = Example1(char_1='char_1', char_2='char_2', char_3='char_3', char_4='char_4')
    ex1.save()
    add_plugin(ex1.placeholder, u'TextPlugin', u'en', body=render_placeholder_body)
    t = '{%    extends    "base.html"    %}\n{%    load    cms_tags    %}\n\n{%    block    content    %}\n<h1>{%    render_placeholder    ex1.placeholder    %}</h1>\n<h2>{%    render_placeholder    ex1.placeholder    as    tempvar    %}</h2>\n<h3>{{    tempvar    }}</h3>\n{%    endblock    content    %}\n'
    r = self.render(self.test_page, template=t, context_vars={'ex1': ex1})
    self.assertIn(('<h1>%s</h1>' % render_placeholder_body), r)
    self.assertIn('<h2></h2>', r)
    self.assertIn(('<h3>%s</h3>' % render_placeholder_body), r)
