refactoring(Purchase): simplify payment_method #47
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from django.test import TestCase
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from ..models import Customer, Product, Sale, SaleLine
|
||||
|
||||
|
||||
@@ -24,6 +26,17 @@ class ConfiaoTest(TestCase):
|
||||
|
||||
self.assertIsInstance(sale, Sale)
|
||||
|
||||
def test_can_create_sale_without_payment_method(self):
|
||||
sale = Sale()
|
||||
sale.customer = self.customer
|
||||
sale.date = "2024-06-22"
|
||||
sale.phone = '666666666'
|
||||
sale.description = "Description"
|
||||
sale.payment_method = ''
|
||||
|
||||
with self.assertRaises(ValidationError):
|
||||
sale.full_clean()
|
||||
|
||||
def test_create_sale_line(self):
|
||||
sale = Sale()
|
||||
sale.customer = self.customer
|
||||
|
||||
Reference in New Issue
Block a user