mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-33096: Fix ttk.Treeview.insert. (GH-6228)
Allow ttk.Treeview.insert to insert iid that has a false boolean value. Note iid=0 and iid=False would be same.
This commit is contained in:
parent
2b75fc2bc9
commit
3ab44c0783
3 changed files with 14 additions and 1 deletions
|
@ -1662,6 +1662,15 @@ class TreeviewTest(AbstractWidgetTest, unittest.TestCase):
|
|||
self.tv.insert('', 'end', text=value), text=None),
|
||||
value)
|
||||
|
||||
# test for values which are not None
|
||||
itemid = self.tv.insert('', 'end', 0)
|
||||
self.assertEqual(itemid, '0')
|
||||
itemid = self.tv.insert('', 'end', 0.0)
|
||||
self.assertEqual(itemid, '0.0')
|
||||
# this is because False resolves to 0 and element with 0 iid is already present
|
||||
self.assertRaises(tkinter.TclError, self.tv.insert, '', 'end', False)
|
||||
self.assertRaises(tkinter.TclError, self.tv.insert, '', 'end', '')
|
||||
|
||||
|
||||
def test_selection(self):
|
||||
self.assertRaises(TypeError, self.tv.selection, 'spam')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue