You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most (all?) browsers exclude disabled form fields (e.g. <input type="text" name="whatever" disabled>) from the form data they send during form submission. However, webtest doesn’t do this, which made several tests of mine fail. Is there a way to mimic this behaviour?
The text was updated successfully, but these errors were encountered:
Four years late to this particular party, but also bitten by this in some tests that were dependent on disabled fields not getting sent on submit.
I don't have time to provide a patch, sorry, but for anyone else coming across this issue here's a quick and dirty fix to use in a test to prune out disabled fields before submitting:
form = my_response_object.forms['my-form']
for name_field_tuple in form.field_order[:]:
if 'disabled' in name_field_tuple[1].attrs:
form.field_order.remove(name_field_tuple)
form.submit()
Worked for me as I didn't need to do anything else with the form object after submitting.
Most (all?) browsers exclude disabled form fields (e.g.
<input type="text" name="whatever" disabled>
) from the form data they send during form submission. However, webtest doesn’t do this, which made several tests of mine fail. Is there a way to mimic this behaviour?The text was updated successfully, but these errors were encountered: