I've a test helper that populates a form that I'm porting from mechanize to webtest. During this I've noticed that webtest ignores the disabled attribute on individual radio buttons. Given the following HTML:
<html>
<form name="my_form" action="test.html"
enctype="multipart/form-data" method="post">
<input type="radio" name="radio-4" value="1" />
<input type="radio" name="radio-4" value="2" />
<input type="radio" name="radio-4" value="3" />
<input type="radio" name="radio-4" value="4" disabled="disabled" />
<input type="submit" name="submit" value="Submit" />
</form>
</html>
if I feed it to webtest (via a very simple wsgi app) and access the form, the following things stand out,
form.fields['radio-4'].options lists all four options, including the disabled one.
Some interesting details that may be relevant:
- print(form.html) doesn't even show "disabled" attributes
- print(form.text) shows the
disabled="disabled", but the HTML has been reformatted and doesn't match my actual HTML source