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
This seems to have always been this way in webtest, the very first commit (c173c2d) already has the code doing the same (except it returns 'checked' instead of 'on', but that's not related)
That commit seems to be a rename from an older project called wsgitest, but I couldn't go back further so I stopped digging up the past at that point. 😄
Using
webtest.forms
to check the forms generated by my views, thevalue
of a checkbox isNone
when the checkbox is not checked.Here is a very simple reproducer.
First, create a
checkboxes
folder, with acheckboxes/__init__.py
file in it, containing the following:In addition, create the
checkboxes/home.jinja2
template file, containing the following:Install
pyramid
,pyramid_jinja2
andwebtest
, then runpython checkboxes/__init__.py
:Why is the checkbox
value
not what is set in the DOM? This makes testing harder.We found that
checkboxes[1]._value == 'value2'
which is the correct value. But using private attributes doesn't feel right.The text was updated successfully, but these errors were encountered: