from django.test import TestCase
from .models import Product

class ProductTestCase(TestCase):
    def test_product_creation(self):
        product = Product.objects.create(
            name="Тестовый товар",
            barcode="1234567890123",
            shelf_life_days=365,
            dimensions="10x10x10",
            unit_of_measure="шт.",
            manufacturer="Производитель",
            category="Food",
            storage_temperature="+4C",
            promotion="1+1"
        )
        self.assertEqual(Product.objects.count(), 1)
        self.assertEqual(product.name, "Тестовый товар")