def setUp( self ): _app = QCoreApplication( [] ) self.conciliacion = ConciliacionModel() self.conciliacion.idCuentaContable = 1 self.conciliacion.uid = 1 self.conciliacion.insertRow( 0 )
class TestConciliacionModel( unittest.TestCase ): def setUp( self ): _app = QCoreApplication( [] ) self.conciliacion = ConciliacionModel() self.conciliacion.idCuentaContable = 1 self.conciliacion.uid = 1 self.conciliacion.insertRow( 0 ) def test_valid( self ): self.assertTrue( self.conciliacion.valid ) self.conciliacion.uid = 0 self.assertFalse( self.conciliacion.valid ) self.conciliacion.uid = 1 self.conciliacion.idCuentaContable = 0 self.assertFalse( self.conciliacion.valid ) def test_rows( self ): self.assertEqual( self.conciliacion.rowCount(), 1 )