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
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
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)
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)
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)
def test_consumirSaldo_PinIncorrecto(self): consumo = consumir_saldo(0, '2241', 15.00) self.assertFalse(consumo)
def test_consumirSaldo_billeteraInexistente(self): consumo = consumir_saldo(0, '1234ab', 15.00) self.assertFalse(consumo)
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))
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)
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)