Skip to content

Commit a65a860

Browse files
committed
Add tests
1 parent a7e5e6f commit a65a860

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

djangocms_frontend/plugin_tag.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def get_plugin_class(settings_string: str | type) -> type:
7474

7575
def setup():
7676
allowed_plugin_types = tuple(get_plugin_class(cls) for cls in getattr(settings, "CMS_COMPONENT_PLUGINS", []))
77-
if not allowed_plugin_types:
78-
return
7977

8078
for plugin in plugin_pool.get_all_plugins():
8179
if not issubclass(plugin, allowed_plugin_types):

tests/test_plugin_tag.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,13 @@ def test_non_frontend_plugin(self):
119119
result = template.render({"request": None})
120120

121121
self.assertInHTML(expected_result, result)
122+
123+
def test_autohero_component_registered_for_plugin_tag(self):
124+
from cms.plugin_pool import plugin_pool
125+
from djangocms_frontend.plugin_tag import plugin_tag_pool
126+
127+
# Check that the AutoHero plugin is registered
128+
self.assertIn("AutoHeroPlugin", plugin_pool.plugins)
129+
130+
# Check for the AutoHero plugin registration in the plugin_tag_pool
131+
self.assertIn("autohero", plugin_tag_pool)

tests/test_settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,6 @@
129129

130130
CMS_COMPONENT_PLUGINS = [
131131
"djangocms_frontend.cms_plugins.CMSUIPlugin",
132+
"djangocms_frontend.cms_plugins.AutoHeroPlugin",
132133
"TextPlugin",
133134
]

0 commit comments

Comments
 (0)