'Regression test for #4223
Assert that placeholder cache is cleared correctly when a plugin is saved'

def test_render_placeholder_cache(self):

    invalidate_cms_page_cache()
    ex = Example1(char_1='one', char_2='two', char_3='tree', char_4='four')
    ex.save()
    ph1 = ex.placeholder
    test_plugin = add_plugin(ph1, u'TextPlugin', u'en', body='Some    text')
    test_plugin.save()
    request = self.get_request()
    content_renderer = self.get_content_renderer(request)
    context = SekizaiContext()
    context['cms_content_renderer'] = content_renderer
    context['request'] = self.get_request()
    text = content_renderer.render_placeholder(ph1, context)
    self.assertEqual(text, 'Some    text')
    del ph1._plugins_cache
    test_plugin.body = 'Other    text'
    test_plugin.save()
    text = content_renderer.render_placeholder(ph1, context)
    self.assertEqual(text, 'Other    text')
