feat: expand platform APIs, sources, and test coverage
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from apps.parsers.models import (
|
||||
IndustrialCertificateRecord,
|
||||
IndustrialProductRecord,
|
||||
ManufacturerRecord,
|
||||
ParserLoadLog,
|
||||
Proxy,
|
||||
@@ -10,6 +11,7 @@ from django.test import TestCase
|
||||
|
||||
from .factories import (
|
||||
IndustrialCertificateRecordFactory,
|
||||
IndustrialProductRecordFactory,
|
||||
ManufacturerRecordFactory,
|
||||
ParserLoadLogFactory,
|
||||
ProxyFactory,
|
||||
@@ -155,3 +157,35 @@ class ManufacturerRecordModelTest(TestCase):
|
||||
|
||||
self.assertIsNotNone(manufacturer.created_at)
|
||||
self.assertIsNotNone(manufacturer.updated_at)
|
||||
|
||||
|
||||
class IndustrialProductRecordModelTest(TestCase):
|
||||
"""Tests for IndustrialProductRecord model."""
|
||||
|
||||
def test_create_industrial_product(self):
|
||||
"""Test creating industrial product record."""
|
||||
product = IndustrialProductRecordFactory()
|
||||
|
||||
self.assertIsInstance(product, IndustrialProductRecord)
|
||||
self.assertIsNotNone(product.registry_number)
|
||||
self.assertIsNotNone(product.product_name)
|
||||
self.assertIsNotNone(product.inn)
|
||||
self.assertIsNotNone(product.ogrn)
|
||||
|
||||
def test_industrial_product_str(self):
|
||||
"""Test industrial product string representation."""
|
||||
registry_number = fake.bothify(text="MPP-########")
|
||||
product_name = generate_company_name()
|
||||
product = IndustrialProductRecordFactory(
|
||||
registry_number=registry_number,
|
||||
product_name=product_name,
|
||||
)
|
||||
self.assertIn(registry_number, str(product))
|
||||
self.assertIn(product_name[:50], str(product))
|
||||
|
||||
def test_industrial_product_timestamps(self):
|
||||
"""Test industrial product has timestamps from mixin."""
|
||||
product = IndustrialProductRecordFactory()
|
||||
|
||||
self.assertIsNotNone(product.created_at)
|
||||
self.assertIsNotNone(product.updated_at)
|
||||
|
||||
Reference in New Issue
Block a user