You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
792 B

from django.test import TestCase
from .models import Manufacturer, STATUS_DEFAULT
class ManufactureTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.mock_path_to_image = 'path/to/image/file.png'
Manufacturer.objects.create(name='TestManufacture', image=cls.mock_path_to_image, status=STATUS_DEFAULT)
def test_default_status(self):
manufacture_obj = Manufacturer.objects.get(name='TestManufacture')
self.assertEqual(manufacture_obj.status, STATUS_DEFAULT)
def test_path_to_image(self):
manufacture_obj = Manufacturer.objects.get(name='TestManufacture')
self.assertEqual(manufacture_obj.image, self.mock_path_to_image)
class ProductCategoryTestCase(TestCase):
pass
class ProductTestCase(TestCase):
pass