コード例 #1
0
    def test_muchos_consumos(self):
        b = self.crear_billetera()

        for num in range(0, 10000):
            consumir_saldo(b.id, '1234', 0)

        id = 0
        consumos = obtener_consumos(b.id, '1234')

        for elemento in consumos:
            self.assertTrue(elemento.id == id)
            id = id + 1
コード例 #2
0
    def test_muchos_consumos(self):
        b = self.crear_billetera()
        
        for num in range(0,10000):
            consumir_saldo(b.id,'1234',0)

        id = 0 
        consumos = obtener_consumos(b.id,'1234')  

        for elemento in consumos:
            self.assertTrue(elemento.id == id)  
            id = id+1        
コード例 #3
0
	def test_consumirSaldo_MontoConsumoSinDecimales(self):
		b = self.crear_billetera()
		consumo = consumir_saldo(b.id, '1234ab', 15)
		b_aux = Billetera.objects.get(id = b.id)
		saldo = b_aux.saldo
		self.assertTrue(consumo)
		self.assertEqual(saldo, b.saldo-15)
コード例 #4
0
 def test_un_consumo(self):
     b = self.crear_billetera()
     consumo = consumir_saldo(b.id, '1234', 0)
     consumos = obtener_consumos(b.id, '1234')
     for elemento in consumos:
         self.assertTrue(elemento.id == consumos.id)
コード例 #5
0
 def test_un_consumo(self):
     b = self.crear_billetera()
     consumo = consumir_saldo(b.id,'1234',0)
     consumos = obtener_consumos(b.id,'1234')
     for elemento in consumos:
         self.assertTrue(elemento.id == consumos.id) 
コード例 #6
0
	def test_consumirSaldo_PinIncorrecto(self):
		consumo = consumir_saldo(0, '2241', 15.00)
		self.assertFalse(consumo)
コード例 #7
0
	def test_consumirSaldo_billeteraInexistente(self):
		consumo = consumir_saldo(0, '1234ab', 15.00)
		self.assertFalse(consumo)
コード例 #8
0
	def test_consumirSaldo_MontoConsumoMayorASaldo(self):
		b = self.crear_billetera()
		consumo = consumir_saldo(b.id, '1234ab', 1000.01)
		b_aux = Billetera.objects.get(id = b.id)
		saldo = b_aux.saldo
		self.assertEqual(saldo, float(consumo))
コード例 #9
0
	def test_consumirSaldo_MontoConsumoTresDecimales(self):
		b = self.crear_billetera()
		consumo = consumir_saldo(b.id, '1234ab', 9.876)
		b_aux = Billetera.objects.get(id = b.id)
		saldo = b_aux.saldo
		self.assertTrue(consumo)
コード例 #10
0
	def test_consumirSaldo_MontoConsumoIgualASaldo(self):
		b = self.crear_billetera()
		consumo = consumir_saldo(b.id, '1234ab', 1000)
		b_aux = Billetera.objects.get(id = b.id)
		saldo = b_aux.saldo
		self.assertTrue(consumo)