mirror of
https://github.com/django-components/django-components.git
synced 2025-08-31 11:17:21 +00:00
feat: allow to set defaults (#1072)
* feat: allow to set defaults * docs: update changelog * refactor: fix new linter errors
This commit is contained in:
parent
48dd3b7a5a
commit
f07818fc7d
16 changed files with 553 additions and 36 deletions
|
@ -293,7 +293,7 @@ class TestComponent:
|
|||
class TestComponent(Component):
|
||||
@no_type_check
|
||||
def get_context_data(self, var1, var2, variable, another, **attrs):
|
||||
assert self.input.args == (123, "str")
|
||||
assert self.input.args == [123, "str"]
|
||||
assert self.input.kwargs == {"variable": "test", "another": 1}
|
||||
assert isinstance(self.input.context, Context)
|
||||
assert list(self.input.slots.keys()) == ["my_slot"]
|
||||
|
@ -305,7 +305,7 @@ class TestComponent:
|
|||
|
||||
@no_type_check
|
||||
def get_template(self, context):
|
||||
assert self.input.args == (123, "str")
|
||||
assert self.input.args == [123, "str"]
|
||||
assert self.input.kwargs == {"variable": "test", "another": 1}
|
||||
assert isinstance(self.input.context, Context)
|
||||
assert list(self.input.slots.keys()) == ["my_slot"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue