mirror of
https://github.com/django-components/django-components.git
synced 2025-09-11 00:16:17 +00:00
Add test for calling the component template tag with positional arg.
This commit is contained in:
parent
aa4a3092c8
commit
f60b443f07
1 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,13 @@ class ComponentTemplateTagTest(SimpleTestCase):
|
||||||
rendered = template.render(Context({}))
|
rendered = template.render(Context({}))
|
||||||
self.assertHTMLEqual(rendered, "Variable: <strong>variable</strong>\n")
|
self.assertHTMLEqual(rendered, "Variable: <strong>variable</strong>\n")
|
||||||
|
|
||||||
|
def test_component_called_with_positional_name(self):
|
||||||
|
component.registry.register(name="test", component=SimpleComponent)
|
||||||
|
|
||||||
|
template = Template('{% load component_tags %}{% component "test" variable="variable" %}')
|
||||||
|
rendered = template.render(Context({}))
|
||||||
|
self.assertHTMLEqual(rendered, "Variable: <strong>variable</strong>\n")
|
||||||
|
|
||||||
def test_multiple_component_dependencies(self):
|
def test_multiple_component_dependencies(self):
|
||||||
component.registry.register(name="test1", component=SimpleComponent)
|
component.registry.register(name="test1", component=SimpleComponent)
|
||||||
component.registry.register(name="test2", component=SimpleComponent)
|
component.registry.register(name="test2", component=SimpleComponent)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue