zope.app.tree.node error in hasChildren()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Won't Fix
|
Undecided
|
Unassigned | ||
zope.app.tree |
New
|
Undecided
|
Unassigned |
Bug Description
The hasChildren() method of zope.app.
The below test case, if added to the test_node.py module in the zope.app.tree.tests package, exemplifies the issue (please note that the patch in https:/
def test_filter(self):
#An empty filter would filter all content out
children = [node.context for node in filtered_
expected = []
The test fails on the last assertion because the hasChildren() method delegates to the synonymous method of the adapter, which is NOT filter aware.
A rough way around it is to change the hasChildren() method in node.py to return the length of getChildNodes() if the Node object has a filter defined. More efficient ways could probably be implemented and any comment on it would be appreciated.
Best regards,
Dragos.
Changed in zope3: | |
status: | New → Won't Fix |