feat: add parser source dashboard and scheduling
All checks were successful
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 1m6s
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m18s
CI/CD Pipeline / Build Docker Images (pull_request) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (pull_request) Has been skipped

This commit is contained in:
2026-04-27 23:36:28 +02:00
parent 199d871923
commit 44355deeb3
96 changed files with 15015 additions and 309 deletions

View File

@@ -1,15 +1,16 @@
"""Tests for parsers models."""
from django.test import TestCase
from apps.parsers.models import (
GenericParserRecord,
IndustrialCertificateRecord,
ManufacturerRecord,
ParserLoadLog,
Proxy,
)
from django.test import TestCase
from .factories import (
GenericParserRecordFactory,
IndustrialCertificateRecordFactory,
ManufacturerRecordFactory,
ParserLoadLogFactory,
@@ -139,3 +140,26 @@ class ManufacturerRecordModelTest(TestCase):
self.assertIsNotNone(manufacturer.created_at)
self.assertIsNotNone(manufacturer.updated_at)
class GenericParserRecordModelTest(TestCase):
"""Tests for GenericParserRecord model."""
def test_create_generic_record(self):
"""Test creating generic parser record."""
record = GenericParserRecordFactory()
self.assertIsInstance(record, GenericParserRecord)
self.assertEqual(record.source, ParserLoadLog.Source.FNS_FINANCIAL)
self.assertIsNotNone(record.external_id)
self.assertIsInstance(record.payload, dict)
def test_generic_record_str(self):
"""Test generic record string representation."""
record = GenericParserRecordFactory(
source=ParserLoadLog.Source.TRUDVSEM,
organisation_name='ООО "Тест"',
)
self.assertIn(ParserLoadLog.Source.TRUDVSEM, str(record))
self.assertIn("Тест", str(record))