fix(parsers): make source jobs resumable
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 1m11s
CI/CD Pipeline / Build and Push Images (push) Successful in 19s
CI/CD Pipeline / Internal Notify (push) Successful in 0s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 24s

This commit is contained in:
2026-08-14 17:02:56 +02:00
parent a0eb0a5303
commit 31eaa7e907
14 changed files with 884 additions and 476 deletions

View File

@@ -2,6 +2,7 @@ from dataclasses import asdict
from apps.parsers import tasks
from apps.parsers.clients.common.structured import MAX_FILE_SIZE_BYTES
from apps.parsers.serializers import ParserRunRequestSerializer
from apps.parsers.source_registry import PARSER_SOURCES
from apps.parsers.views import TASKS_BY_NAME
from django.conf import settings
@@ -53,3 +54,19 @@ class ParserSourceRegistryPresentationTest(SimpleTestCase):
)
self.assertNotIn("checko", public_metadata.lower())
def test_vacancy_source_metadata_names_only_trudvsem(self):
source = PARSER_SOURCES["trudvsem"]
self.assertEqual(source.agency, "Работа России")
self.assertEqual(source.parser_strategy, "incremental_trudvsem_api")
self.assertNotIn("HH", source.data_scope)
self.assertNotIn("SuperJob", source.data_scope)
def test_vacancy_run_request_rejects_disabled_sources(self):
serializer = ParserRunRequestSerializer(
data={"vacancy_sources": ["hh", "superjob"]}
)
self.assertFalse(serializer.is_valid())
self.assertIn("vacancy_sources", serializer.errors)