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