def test_removeRow(self): rootnode = self.session.query(Check).filter_by(parent_id=None).first() model = GenericTreeModel(rootnode, treenode=Check) index = model.createIndex(0, 0, rootnode) check = CheckAbapCountTableEntries( name='Clients 001 and 066 removed', description= 'If client 001 is not actively used, it can be deleted. Client 066 is no longer required in any case', ) param001 = CheckAbapCountTableEntries__params( table_name='T000', table_fields='MANDT', expected_count=0, operator='NE', where_clause="MANDT EQ '001'") param066 = CheckAbapCountTableEntries__params( table_name='T000', table_fields='MANDT', expected_count=0, operator='NE', where_clause="MANDT EQ '066'") check.params.append(param001) model.insertRow(0, index, nodeObject=check) self.assertEqual(model.rowCount(index), 1) model.removeRow(0, index) self.assertEqual(model.rowCount(index), 0)
def test_removeRow(self): rootnode = self.session.query(GenericSystemTreeNode).filter_by( parent_id=None).one() model = GenericTreeModel(rootnode, treenode=GenericSystemTreeNode) index = model.createIndex(0, 0, rootnode) model.insertRow(0, index) self.assertEqual(model.rowCount(index), 1) model.removeRow(0, index) self.assertEqual(model.rowCount(index), 0)