mirror of
https://github.com/django-components/django-components.git
synced 2025-10-22 03:31:45 +00:00
refactor: add test
This commit is contained in:
parent
3f8abc7388
commit
3050dc71b9
1 changed files with 18 additions and 0 deletions
|
@ -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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue