'Tests that {% render_placeholder %} populates cache.'

def test_render_placeholder_tag_use_cache(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()
    request = self.get_request('/')
    add_plugin(ex1.placeholder, u'TextPlugin', u'en', body=render_placeholder_body)
    template = '{%    load    cms_tags    %}<h1>{%    render_placeholder    ex1.placeholder    %}</h1>'
    cache_value_before = get_placeholder_cache(ex1.placeholder, 'en', 1, request)
    self.render(self.test_page, template, {'ex1': ex1})
    cache_value_after = get_placeholder_cache(ex1.placeholder, 'en', 1, request)
    self.assertNotEqual(cache_value_before, cache_value_after)
    self.assertIsNone(cache_value_before)
    self.assertIsNotNone(cache_value_after)
