feat(Payments): Generate cash payment with purchase.
This commit is contained in:
		| @@ -19,7 +19,7 @@ class TestPurchaseWithPayment(TestCase): | ||||
|         quantity = 2 | ||||
|         unit_price = 2500 | ||||
|         total = 5000 | ||||
|         response = self.client.post( | ||||
|         self.client.post( | ||||
|             '/don_confiao/comprar', | ||||
|             { | ||||
|                 "customer": str(self.customer.id), | ||||
| @@ -42,6 +42,10 @@ class TestPurchaseWithPayment(TestCase): | ||||
|                 "payment_method": "CASH", | ||||
|             } | ||||
|         ) | ||||
|  | ||||
|         purchases = Sale.objects.all() | ||||
|         self.assertEqual(1, len(purchases)) | ||||
|         payments = Payment.objects.all() | ||||
|         self.assertEqual(1, len(payments)) | ||||
|         self.assertEqual(total, payments[0].amount) | ||||
|         self.assertEqual('CASH', payments[0].type_payment) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user