Open vernans opened 4 years ago
Failure tracebacks for reference:
Error in test test_checkbox_controls_with_same_name_1 (zope.testbrowser.tests.test_browser.TestsSameNameAndCheckboxes)
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/tests/test_browser.py", line 232, in test_checkbox_controls_with_same_name_1
browser.getControl('Not There')
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 397, in getControl
available)
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 1354, in disambiguate
for choice in available])
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 643, in controlFormTupleRepr
return wtcontrol.mechRepr()
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 775, in mechRepr
raise NotImplementedError(str((self, ctrl)))
NotImplementedError: (<Control name='None' type='checkbox'>, <Checkbox name="None" id="checkbox">)
Failure in test test_checkbox_controls_with_same_name_2 (zope.testbrowser.tests.test_browser.TestsSameNameAndCheckboxes)
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/tests/test_browser.py", line 250, in test_checkbox_controls_with_same_name_2
assert isinstance(control, ItemControl)
AssertionError
Error in test test_checkbox_controls_with_same_name_3 (zope.testbrowser.tests.test_browser.TestsSameNameAndCheckboxes)
Traceback (most recent call last):
File "/usr/lib/python2.7/unittest/case.py", line 329, in run
testMethod()
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/tests/test_browser.py", line 269, in test_checkbox_controls_with_same_name_3
browser.getControl('Not There')
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 397, in getControl
available)
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 1354, in disambiguate
for choice in available])
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 643, in controlFormTupleRepr
return wtcontrol.mechRepr()
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 1247, in mechRepr
if self.selected:
File "/home/mg/src/zopefoundation/zope.testbrowser/.tox/py27/local/lib/python2.7/site-packages/zope/testbrowser/browser.py", line 1215, in selected
return self._control.checked
AttributeError: 'Submit' object has no attribute 'checked'
Checkboxes become multiple controls that are handled together when they are collected by
Browser._findAllControls()
. Usually they all have the same name. When there are other fields with the same name – or in a more normal and case multiple inputs with no name – unexpected errors are possible. Has anybody any idea how to fix this? Those tests assert the expected behaviour but fail with the current implementation.