Esempio n. 1
0
def updateFund(name, amount):
    '''
    @permission private function to generalize the changes in the funds and the connection with the DB
    @param name:string, by who the action has been made
    @param amount:float
    @return:
    '''
    currentStatus = DBController.getLastFundStatus()
    DBController.updateFundStatus(currentStatus + amount)
    DBController.saveTransaction(name, amount)
    return
Esempio n. 2
0
 def test_updateFundStatus(self):
     db.updateFundStatus(18)
     #list=db.DBConnection.FundStatus.find().sort([('time',-1)]).limit(1)
     record = db.getLastFundStatus()
     self.assertEqual(record, 18)