create a page with cms.api... and then get the right placeholder form page.placeholders.all() and call the add_plugin() with this.
Add plugin on Django-CMS page programatically in unit test
-
06-10-2022 - |
Question
My Django app needs a test that follows the following scenario: creates a page, edits it by adding a new plugin, then saves it. So far, I am stuck at adding the plugin to the page. How can I do this programatically in a test?
I looked over add_plugin()
from cms.api
, but it needs a placeholder, which I have no idea how to link to an existing page and/or template.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow