Skip to content

Commit

Permalink
Remove usage of plugin.render() in sample code (#5735)
Browse files Browse the repository at this point in the history
  • Loading branch information
meomap authored and czpython committed Oct 23, 2016
1 parent 2949e3f commit a63a6e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/how_to/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ it or the context provided to its template::


from django.test import TestCase
from django.test.client import RequestFactory

from cms.api import add_plugin
from cms.models import Placeholder
from cms.plugin_rendering import ContentRenderer

from myapp.cms_plugins import MyPlugin
from myapp.models import MyappPlugin
Expand All @@ -95,6 +97,7 @@ it or the context provided to its template::
MyPlugin,
'en',
)
html = model_instance.render_plugin({})
renderer = ContentRenderer(request=RequestFactory())
html = renderer.render_plugin(model_instance, {})
self.assertEqual(html, '<strong>Test</strong>')

0 comments on commit a63a6e3

Please sign in to comment.