feat: обновления парсеров, тестов и миграций
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 37s
CI/CD Pipeline / Code Quality Checks (push) Failing after 43s
CI/CD Pipeline / Build & Push Images (push) Has been skipped
CI/CD Pipeline / Deploy (dev) (push) Has been skipped
CI/CD Pipeline / Deploy (prod) (push) Has been skipped
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 0s
CI/CD Pipeline / Run Tests (pull_request) Failing after 0s
CI/CD Pipeline / Build & Push Images (pull_request) Has been skipped
CI/CD Pipeline / Deploy (dev) (pull_request) Has been skipped
CI/CD Pipeline / Deploy (prod) (pull_request) Has been skipped

- Обновлены клиенты парсеров (checko, fns, minpromtorg, proverki, zakupki)
- Добавлены новые миграции для моделей
- Расширено покрытие тестами
- Обновлены конфигурации и настройки проекта
- Добавлены утилиты для тестирования

Co-Authored-By: Warp <agent@warp.dev>
This commit is contained in:
2026-02-10 10:17:47 +01:00
parent 975d019ba5
commit ee95628a0a
59 changed files with 7292 additions and 2876 deletions

View File

@@ -56,6 +56,7 @@ class BaseAppCommand(BaseCommand):
requires_migrations_checks = True
requires_system_checks = "__all__"
use_transaction = False # Обернуть в транзакцию
input_func = staticmethod(input)
def add_arguments(self, parser) -> None:
"""Добавление базовых аргументов."""
@@ -240,7 +241,8 @@ class BaseAppCommand(BaseCommand):
return True
self.stdout.write(f"\n{message} [y/N]: ", ending="")
response = input().strip().lower()
input_func = getattr(self, "input_func", input)
response = input_func().strip().lower()
return response in ("y", "yes", "да", "д")
def abort(self, message: str) -> None:

View File

@@ -26,7 +26,7 @@ class BackgroundJobSerializer(serializers.Serializer):
started_at = serializers.DateTimeField(read_only=True)
completed_at = serializers.DateTimeField(read_only=True)
created_at = serializers.DateTimeField(read_only=True)
duration = serializers.FloatField(read_only=True, source="duration")
duration = serializers.FloatField(read_only=True)
# Вычисляемые поля
is_finished = serializers.BooleanField(read_only=True)

View File

@@ -107,7 +107,10 @@ class BaseService(Generic[M]):
"""
for field, value in kwargs.items():
setattr(instance, field, value)
instance.save(update_fields=list(kwargs.keys()))
update_fields = set(kwargs.keys())
if hasattr(instance, "updated_at"):
update_fields.add("updated_at")
instance.save(update_fields=list(update_fields))
return instance
@classmethod

View File

@@ -57,8 +57,8 @@ class BaseTask(Task):
extra={
"task_id": task_id,
"task_name": self.name,
"args": str(args)[:200],
"kwargs": str(kwargs)[:200],
"task_args": str(args)[:200],
"task_kwargs": str(kwargs)[:200],
},
)
@@ -94,8 +94,8 @@ class BaseTask(Task):
"task_id": task_id,
"task_name": self.name,
"exception": str(exc),
"args": str(args)[:200],
"kwargs": str(kwargs)[:200],
"task_args": str(args)[:200],
"task_kwargs": str(kwargs)[:200],
},
exc_info=True,
)