make customer name required field.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user