refactor: add test

This commit is contained in:
Juro Oravec 2024-04-11 23:44:36 +02:00
parent 3f8abc7388
commit 3050dc71b9

View file

@ -186,6 +186,24 @@ class ComponentTest(SimpleTestCase):
), ),
) )
def test_component_with_relative_paths_as_subcomponent(
self,
):
template = Template(
"""
{% load component_tags %}{% component_dependencies %}
{% component 'parent_component' %}
{% fill 'content' %}
{% component name='relative_file_component' variable='hello' %}
{% endcomponent %}
{% endfill %}
{% endcomponent %}
""" # NOQA
)
rendered = template.render(Context({}))
self.assertIn('<input type="text" name="variable" value="hello">', rendered, rendered)
class InlineComponentTest(SimpleTestCase): class InlineComponentTest(SimpleTestCase):
def test_inline_html_component(self): def test_inline_html_component(self):