mirror of
https://github.com/django-components/django-components.git
synced 2025-09-24 22:52:28 +00:00
Add test for calling component with positional name.
This commit is contained in:
parent
a87b6734f4
commit
d48502c40b
1 changed files with 9 additions and 0 deletions
|
@ -104,6 +104,15 @@ class ComponentTemplateTagTest(SimpleTestCase):
|
|||
rendered = template.render(Context({}))
|
||||
self.assertHTMLEqual(rendered, "Variable: <strong>variable</strong>\n")
|
||||
|
||||
def test_single_component_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_call_component_with_two_variables(self):
|
||||
component.registry.register(name="test", component=IffedComponent)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue