I can bind radio
This commit is contained in:
@@ -280,20 +280,6 @@ def test_i_cannot_activate_without_configuration(data):
|
||||
binding.activate()
|
||||
|
||||
|
||||
def test_activation_validates_ft_name(data):
|
||||
"""
|
||||
Activation should fail if ft_name is not configured.
|
||||
"""
|
||||
elt = Label("hello", id="label_id")
|
||||
binding = Binding(data, "value")
|
||||
binding.ft = elt
|
||||
binding._detection = binding._factory(DetectionMode.ValueChange)
|
||||
binding._update = binding._factory(UpdateMode.ValueChange)
|
||||
|
||||
with pytest.raises(ValueError, match="ft_name is required"):
|
||||
binding.activate()
|
||||
|
||||
|
||||
def test_activation_validates_strategies(data):
|
||||
"""
|
||||
Activation should fail if detection/update strategies are not initialized.
|
||||
@@ -387,3 +373,11 @@ def test_multiple_bindings_can_coexist(data):
|
||||
data.value = "final"
|
||||
assert elt1.children[0] == "updated" # Not changed
|
||||
assert elt2.attrs["value"] == "final" # Changed
|
||||
|
||||
|
||||
def test_i_cannot_bind_when_htmx_post_already_set(data):
|
||||
elt = Input(name="input_elt", hx_post="/some/url")
|
||||
binding = Binding(data, "value")
|
||||
|
||||
with pytest.raises(ValueError, match="htmx post already set on input"):
|
||||
binding.bind_ft(elt, name="label_name")
|
||||
|
||||
Reference in New Issue
Block a user