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.

18 lines
647 B

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, "Тестовый товар")