mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 14:28:18 +00:00
refecator: move defaults applying back to ext, raise on passing Slot to Slot, and docs cleanup (#1214)
* refecator: move defaults applying back to ext, raise on passing Slot to Slot, and docs cleanup * docs: fix typo
This commit is contained in:
parent
bae0f28813
commit
55b1c8bc62
14 changed files with 317 additions and 147 deletions
|
@ -116,6 +116,15 @@ class TestSlot:
|
|||
slots={"first": "SLOT_FN"},
|
||||
)
|
||||
|
||||
def test_render_raises_on_slot_instance_in_slot_constructor(self):
|
||||
slot: Slot = Slot(lambda ctx: "SLOT_FN")
|
||||
|
||||
with pytest.raises(
|
||||
ValueError,
|
||||
match=re.escape("Slot received another Slot instance as `contents`"),
|
||||
):
|
||||
Slot(slot)
|
||||
|
||||
def test_render_slot_in_python__minimal(self):
|
||||
def slot_fn(ctx: SlotContext):
|
||||
assert ctx.context is None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue