Пример #1
0
 def test_insertRows(self):
     rootnode = self.session.query(GenericSystemTreeNode).filter_by(
         parent_id=None).one()
     model = GenericTreeModel(rootnode, treenode=GenericSystemTreeNode)
     index = model.createIndex(0, 0, rootnode)
     model.insertRows(0, 10, index)
     self.assertEqual(model.rowCount(index), 10)
Пример #2
0
 def test_removeRows(self):
     rootnode = self.session.query(Check).filter_by(parent_id=None).first()
     model = GenericTreeModel(rootnode, treenode=Check)
     index = model.createIndex(0, 0, rootnode)
     model.insertRows(0, 10, index)
     self.assertEqual(model.rowCount(index), 10)
     model.removeRows(1, 5, index)
     self.assertEqual(model.rowCount(index), 5)