Skip to content

Commit 7253a9e

Browse files
committed
Update tests
1 parent 677cf7e commit 7253a9e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

djangocms_frontend/component_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def plugin_model_factory(cls) -> type:
108108
from djangocms_frontend.models import FrontendUIItem
109109

110110
app_config = apps.get_containing_app_config(cls.__module__)
111-
if app_config is None:
111+
if app_config is None: # pragma: no cover
112112
raise ValueError(f"Cannot find app_config for {cls.__module__}")
113113
cls._model = type(
114114
cls.__name__,

djangocms_frontend/templatetags/cms_component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class based on the implate it is part of. The component class is generated
2222
str: An empty string, as this function is intended for side effects only.
2323
"""
2424
if "_cms_components" in context:
25-
if len(args) != 1:
25+
if len(args) != 1: # pragma: no cover
2626
raise ValueError("The cms_component tag requires exactly one positional argument: the component name.")
2727
context["_cms_components"]["cms_component"].append((args, kwargs))
2828
return ""

tests/test_autocomponent.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ def test_render_autocomponent(self):
4040
self.assertContains(response, 9 * "\n" + '<section class="bg-white dark:bg-gray-900">')
4141
self.assertContains(response, "My Hero")
4242
self.assertContains(response, "My Hero Slogan")
43+
44+
def test_split_template_tag(self):
45+
from djangocms_frontend.templatetags.cms_component import split
46+
47+
self.assertEqual(split("hero.html"), ["hero.html"])
48+
self.assertEqual(split("Mixin1|Mixin2"), ["Mixin1", "Mixin2"])
49+
self.assertEqual(split("hero.html"), ["hero.html"])
50+
self.assertEqual(split("hero.html, Mixin1, Mixin2", ", "), ["hero.html", "Mixin1", "Mixin2"])

0 commit comments

Comments
 (0)