def setUp(self): #Init DB self.db = dbConnection.getDBCursor('10.0.10.26', 1521, 'desa11g', 'billing', 'GHaURU13') self.cur = self.db.cursor() #Insert test data self.cur.execute( "INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('$','IBZ','BV',347692,4284859,10837411,NULL,6759204,1,-0.97,TO_DATE('13-AUG-2002 22:47:39','DD-MON-RRRR HH24:MI:SS'),'F','I',TO_DATE('04-SEP-2002 13:13:21','DD-MON-RRRR HH24:MI:SS'),4112436,10205213,NULL,1,'MLB','REA',-1.92,-6,NULL,'MED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,TO_DATE('23-MAY-2008 12:14:27','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,NULL,NULL)" ) self.db.commit() #Delete bonus self.cur.execute('delete from MAIN_BONUSES where CHARGE_ID=4284859') self.db.commit() #Update self.cur.execute( "UPDATE CHARGES SET CURRENCY_ID='u$s',SITE_ID='MLA',ITEM_ID=321,AFF_PYMNT_CHARGE=321,AFF_CHARGE_PRICE=321,AFF_SITE_CHARGE=321,ORIG_CURRENCY='TST',ORIG_UNIT_PRICE=321,ORIG_ITEM_CURRENCY='%',ORIG_ITEM_UNIT_PRICE=321,CHARGE_TYPE_ID='BV' WHERE CHARGE_ID=4284859" ) self.db.commit() #Obtengo el id del cargo actualizado self.cur.execute( 'select * from CHARGES where rownum<=1 and CHARGE_ID=4284859 order by TIMESTAMP desc' ) #Armo diccionario de datos dict = self.createDict(self.cur) result = dict[0] fieldNames = dict[1] for row in result: self.chargeId = row[fieldNames['CHARGE_ID']] self.custId = row[fieldNames['CUST_ID']] self.siteId = row[fieldNames['SITE_ID']] self.unitPrice = row[fieldNames['UNIT_PRICE']] self.quantity = row[fieldNames['QUANTITY']] self.currencyId = row[fieldNames['CURRENCY_ID']] self.itemId = row[fieldNames['ITEM_ID']] self.type = row[fieldNames['CHARGE_TYPE_ID']] self.status = row[fieldNames['CHARGE_STATUS']] self.marketplace = row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated = row[fieldNames['INS_DT']] self.chargeDateCreated = row[fieldNames['CHARGE_DT']] self.fromId = row[fieldNames['FROM_PRG']] self.affChargePrice = row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge = row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge = row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency = row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice = row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency = row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice = row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount = row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db = dbConnection.getDBCursor('10.0.10.26', 1521, 'desa11g', 'billing', 'GHaURU13') self.cur = self.db.cursor() #Insert test data self.cur.execute( "INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2006 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)" ) self.db.commit() #Delete charge self.cur.execute('delete from MAIN_CHARGES where CHARGE_ID = 4112095') self.db.commit() #Update self.cur.execute( "UPDATE CHARGES SET CUST_ID=1234,UNIT_PRICE=9,QUANTITY=9,CURRENCY_ID='%',CHARGE_STATUS='I',SITE_ID='MLA',ITEM_ID=123,AFF_PYMNT_CHARGE='123',ORIG_CURRENCY='TST',CHARGE_TYPE_ID='BV' WHERE CHARGE_ID=4112095" ) self.db.commit() #Obtengo el id del cargo actualizado self.cur.execute('select * from CHARGES where CHARGE_ID=4112095') #Armo diccionario de datos dict = self.createDict(self.cur) result = dict[0] fieldNames = dict[1] for row in result: self.chargeId = row[fieldNames['CHARGE_ID']] self.custId = row[fieldNames['CUST_ID']] self.siteId = row[fieldNames['SITE_ID']] self.unitPrice = row[fieldNames['UNIT_PRICE']] self.quantity = row[fieldNames['QUANTITY']] self.currencyId = row[fieldNames['CURRENCY_ID']] self.itemId = row[fieldNames['ITEM_ID']] self.type = row[fieldNames['CHARGE_TYPE_ID']] self.status = row[fieldNames['CHARGE_STATUS']] self.marketplace = row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated = row[fieldNames['INS_DT']] self.chargeDateCreated = row[fieldNames['CHARGE_DT']] self.fromId = row[fieldNames['FROM_PRG']] self.affChargePrice = row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge = row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge = row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency = row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice = row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency = row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice = row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount = row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db = dbConnection.getDBCursor('10.0.10.26', 1521, 'desa11g', 'billing', 'GHaURU13') self.cur = self.db.cursor() #Insert test data self.cur.execute( "INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2012 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2012 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2012 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)" ) self.db.commit() #Corro script f = open('resources/CARGA_INICIAL_CHARGES.SQL') full_sql = f.read() self.cur.execute(full_sql) #Obtengo datos del insertado self.cur.execute( 'select * from CHARGES where rownum<=1 and charge_id=4112095 order by TIMESTAMP desc' ) #Armo diccionario de datos dict = self.createDict(self.cur) result = dict[0] fieldNames = dict[1] for row in result: self.chargeId = 4112095 self.custId = row[fieldNames['CUST_ID']] self.siteId = row[fieldNames['SITE_ID']] self.unitPrice = row[fieldNames['UNIT_PRICE']] self.quantity = row[fieldNames['QUANTITY']] self.currencyId = row[fieldNames['CURRENCY_ID']] self.itemId = row[fieldNames['ITEM_ID']] self.type = row[fieldNames['CHARGE_TYPE_ID']] self.status = row[fieldNames['CHARGE_STATUS']] self.marketplace = row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated = row[fieldNames['INS_DT']] self.chargeDateCreated = row[fieldNames['CHARGE_DT']] self.fromPgr = row[fieldNames['FROM_PRG']] self.fromUser = row[fieldNames['FROM_USER']] self.affChargePrice = row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge = row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge = row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency = row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice = row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency = row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice = row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount = row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db=dbConnection.getDBCursor('10.0.10.26',1521,'desa11g','billing','GHaURU13') self.cur=self.db.cursor() #Insert test data self.cur.execute("INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2006 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)") self.db.commit() #Delete charge self.cur.execute('delete from MAIN_CHARGES where CHARGE_ID = 4112095') self.db.commit() #Update self.cur.execute("UPDATE CHARGES SET CUST_ID=1234,UNIT_PRICE=9,QUANTITY=9,CURRENCY_ID='%',CHARGE_STATUS='I',SITE_ID='MLA',ITEM_ID=123,AFF_PYMNT_CHARGE='123',ORIG_CURRENCY='TST',CHARGE_TYPE_ID='BV' WHERE CHARGE_ID=4112095") self.db.commit() #Obtengo el id del cargo actualizado self.cur.execute('select * from CHARGES where CHARGE_ID=4112095') #Armo diccionario de datos dict=self.createDict(self.cur); result=dict[0] fieldNames=dict[1] for row in result: self.chargeId=row[fieldNames['CHARGE_ID']] self.custId=row[fieldNames['CUST_ID']] self.siteId=row[fieldNames['SITE_ID']] self.unitPrice=row[fieldNames['UNIT_PRICE']] self.quantity=row[fieldNames['QUANTITY']] self.currencyId=row[fieldNames['CURRENCY_ID']] self.itemId=row[fieldNames['ITEM_ID']] self.type=row[fieldNames['CHARGE_TYPE_ID']] self.status=row[fieldNames['CHARGE_STATUS']] self.marketplace=row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated=row[fieldNames['INS_DT']] self.chargeDateCreated=row[fieldNames['CHARGE_DT']] self.fromId=row[fieldNames['FROM_PRG']] self.affChargePrice=row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge=row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge=row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency=row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice=row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency=row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice=row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount=row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db=dbConnection.getDBCursor('10.0.10.26',1521,'desa11g','billing','GHaURU13') self.cur=self.db.cursor() #Insert test data self.cur.execute("INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('$','IBZ','BV',347692,4284859,10837411,NULL,6759204,1,-0.97,TO_DATE('13-AUG-2002 22:47:39','DD-MON-RRRR HH24:MI:SS'),'F','I',TO_DATE('04-SEP-2002 13:13:21','DD-MON-RRRR HH24:MI:SS'),4112436,10205213,NULL,1,'MLB','REA',-1.92,-6,NULL,'MED',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,TO_DATE('23-MAY-2008 12:14:27','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,NULL,NULL)"); self.db.commit() #Delete bonus self.cur.execute('delete from MAIN_BONUSES where CHARGE_ID=4284859') self.db.commit() #Update self.cur.execute("UPDATE CHARGES SET CURRENCY_ID='u$s',SITE_ID='MLA',ITEM_ID=321,AFF_PYMNT_CHARGE=321,AFF_CHARGE_PRICE=321,AFF_SITE_CHARGE=321,ORIG_CURRENCY='TST',ORIG_UNIT_PRICE=321,ORIG_ITEM_CURRENCY='%',ORIG_ITEM_UNIT_PRICE=321,CHARGE_TYPE_ID='BV' WHERE CHARGE_ID=4284859") self.db.commit() #Obtengo el id del cargo actualizado self.cur.execute('select * from CHARGES where rownum<=1 and CHARGE_ID=4284859 order by TIMESTAMP desc') #Armo diccionario de datos dict=self.createDict(self.cur); result=dict[0] fieldNames=dict[1] for row in result: self.chargeId=row[fieldNames['CHARGE_ID']] self.custId=row[fieldNames['CUST_ID']] self.siteId=row[fieldNames['SITE_ID']] self.unitPrice=row[fieldNames['UNIT_PRICE']] self.quantity=row[fieldNames['QUANTITY']] self.currencyId=row[fieldNames['CURRENCY_ID']] self.itemId=row[fieldNames['ITEM_ID']] self.type=row[fieldNames['CHARGE_TYPE_ID']] self.status=row[fieldNames['CHARGE_STATUS']] self.marketplace=row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated=row[fieldNames['INS_DT']] self.chargeDateCreated=row[fieldNames['CHARGE_DT']] self.fromId=row[fieldNames['FROM_PRG']] self.affChargePrice=row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge=row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge=row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency=row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice=row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency=row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice=row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount=row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db=dbConnection.getDBCursor('10.0.10.26',1521,'desa11g','billing','GHaURU13') self.cur=self.db.cursor() #Insert test data self.cur.execute("INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2012 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2012 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2012 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)") self.db.commit() #Corro script f = open('resources/CARGA_INICIAL_CHARGES.SQL') full_sql = f.read() self.cur.execute(full_sql) #Obtengo datos del insertado self.cur.execute('select * from CHARGES where rownum<=1 and charge_id=4112095 order by TIMESTAMP desc') #Armo diccionario de datos dict=self.createDict(self.cur); result=dict[0] fieldNames=dict[1] for row in result: self.chargeId=4112095 self.custId=row[fieldNames['CUST_ID']] self.siteId=row[fieldNames['SITE_ID']] self.unitPrice=row[fieldNames['UNIT_PRICE']] self.quantity=row[fieldNames['QUANTITY']] self.currencyId=row[fieldNames['CURRENCY_ID']] self.itemId=row[fieldNames['ITEM_ID']] self.type=row[fieldNames['CHARGE_TYPE_ID']] self.status=row[fieldNames['CHARGE_STATUS']] self.marketplace=row[fieldNames['CHARGE_TYPE_ID']] self.dateCreated=row[fieldNames['INS_DT']] self.chargeDateCreated=row[fieldNames['CHARGE_DT']] self.fromPgr=row[fieldNames['FROM_PRG']] self.fromUser=row[fieldNames['FROM_USER']] self.affChargePrice=row[fieldNames['AFF_CHARGE_PRICE']] self.affSiteCharge=row[fieldNames['AFF_SITE_CHARGE']] self.affPymntCharge=row[fieldNames['AFF_PYMNT_CHARGE']] self.origCurrency=row[fieldNames['ORIG_CURRENCY']] self.oringUnitPrice=row[fieldNames['ORIG_UNIT_PRICE']] self.origItemCurrency=row[fieldNames['ORIG_ITEM_CURRENCY']] self.origItemUnitPrice=row[fieldNames['ORIG_ITEM_UNIT_PRICE']] self.collectedAmount=row[fieldNames['COLLECTED_AMOUNT']]
def setUp(self): #Init DB self.db=dbConnection.getDBCursor('10.0.10.26',1521,'desa11g','billing','GHaURU13') self.cur=self.db.cursor() #Insert test data self.cur.execute("INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2006 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)") self.db.commit() #Obtengo el id del insertado self.cur.execute('select * from CHARGES where rownum<=1 order by TIMESTAMP desc') #Armo diccionario de datos dict=self.createDict(self.cur); result=dict[0] fieldNames=dict[1] for row in result: self.chargeId=row[fieldNames['CHARGE_ID']]
def setUp(self): #Init DB self.db = dbConnection.getDBCursor('10.0.10.26', 1521, 'desa11g', 'billing', 'GHaURU13') self.cur = self.db.cursor() #Insert test data self.cur.execute( "INSERT INTO CHARGES (CURRENCY_ID,SITE_ID,CHARGE_TYPE_ID,DOC_ID,CHARGE_ID,CUST_ID,CATEG_ID,ITEM_ID,QUANTITY,UNIT_PRICE,CHARGE_DT,CHARGE_STATUS,PAY_STATUS,INS_DT,REF_CHARGE_ID,BID_CUST_ID,PAY_AMOUNT,BID_SEQUENCE,CUST_SITE,ORIG_CURRENCY,DOL_UNIT_PRICE,ORIG_UNIT_PRICE,ORIG_ITEM_UNIT_PRICE,FROM_PRG,ORIG_ITEM_CURRENCY,FROM_USER,COMMENTS,BONIF_STATUS,COLLECTED_AMOUNT,MAIL_BONIF,PREPAY,AFF_SITE_CHARGE,AFF_PYMNT_CHARGE,TIMESTAMP,QTY_BONIF,AFF_CHARGE_PRICE,SEARCH_WORD,COMBO_TYPE_ID) VALUES ('MEX','MLM','CV',358008,4112095,10003446,'1832',3534564,1,0.97,TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),'F','T',TO_DATE('13-AUG-2002 21:47:37','DD-MON-RRRR HH24:MI:SS'),NULL,NULL,0.97,1,'MLM','DOL',0.1,0.1,0.1,NULL,'DOL',NULL,NULL,NULL,NULL,NULL,NULL,219639,11552,TO_DATE('03-JUL-2006 11:23:26','DD-MON-RRRR HH24:MI:SS'),0,0.97,NULL,NULL)" ) self.db.commit() #Obtengo el id del insertado self.cur.execute( 'select * from CHARGES where rownum<=1 order by TIMESTAMP desc') #Armo diccionario de datos dict = self.createDict(self.cur) result = dict[0] fieldNames = dict[1] for row in result: self.chargeId = row[fieldNames['CHARGE_ID']]