make customer name required field.

This commit is contained in:
2024-08-17 09:48:36 -05:00
parent 398f7f2c36
commit 8f611a523b
3 changed files with 31 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from django.test import TestCase
from django.db.utils import IntegrityError
from ..models import Customer
@@ -12,3 +14,8 @@ class TestCustomer(TestCase):
customer.save()
self.assertIsInstance(customer, Customer)
def test_don_create_customer_without_name(self):
customer = Customer()
with self.assertRaises(IntegrityError):
customer.save()