def test_del_payment(self): payment = Paiement() montant = 42 valeur_unitaire = 73 paymentType = PaiementType() payment.montant = 73 payment.type = paymentType payment.valeur_unitaire = Decimal(valeur_unitaire) payment.montant = Decimal(montant) self.facture.add_payment(paymentType, montant, valeur_unitaire) self.facture.del_payment(payment)
def test_rendre_monnaie(self): payment = Paiement() payment.type = PaiementType() payment.montant = Decimal("900") self.facture.add_product(self.plat) self.facture.update() self.facture.rendre_monnaie(payment) left = self.facture.total_ttc - Decimal("900") self.assertEqual(left, self.facture.paiements.all()[0].montant)