Fix Ruff import ordering for CI
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Successful in 1m53s
CI/CD Pipeline / Run Tests (push) Successful in 2m19s
CI/CD Pipeline / Build Docker Images (push) Successful in 3m26s
CI/CD Pipeline / Push to Gitea Registry (push) Failing after 20s
CI/CD Pipeline / Deploy to Server (push) Has been skipped
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Successful in 1m53s
CI/CD Pipeline / Run Tests (push) Successful in 2m19s
CI/CD Pipeline / Build Docker Images (push) Successful in 3m26s
CI/CD Pipeline / Push to Gitea Registry (push) Failing after 20s
CI/CD Pipeline / Deploy to Server (push) Has been skipped
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
"""Тесты для BackgroundJob."""
|
||||
|
||||
from django.test import TestCase
|
||||
from faker import Faker
|
||||
|
||||
from apps.core.models import BackgroundJob, JobStatus
|
||||
from apps.core.services import BackgroundJobService
|
||||
from django.test import TestCase
|
||||
from faker import Faker
|
||||
|
||||
fake = Faker()
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"""Тесты для BulkOperationsMixin и QueryOptimizerMixin."""
|
||||
|
||||
from django.test import TestCase
|
||||
from faker import Faker
|
||||
|
||||
from apps.core.models import BackgroundJob
|
||||
from apps.core.services import (
|
||||
BulkOperationsMixin,
|
||||
QueryOptimizerMixin,
|
||||
)
|
||||
from django.test import TestCase
|
||||
from faker import Faker
|
||||
|
||||
fake = Faker()
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
"""Tests for core cache utilities"""
|
||||
|
||||
from django.core.cache import cache
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.cache import (
|
||||
CacheManager,
|
||||
_build_cache_key,
|
||||
cache_method,
|
||||
cache_result,
|
||||
)
|
||||
from django.core.cache import cache
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class CacheResultDecoratorTest(TestCase):
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.excel import (
|
||||
BaseExcelParser,
|
||||
ColumnMapping,
|
||||
@@ -16,6 +14,7 @@ from apps.core.excel import (
|
||||
validate_ogrn,
|
||||
validate_okpo,
|
||||
)
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class ValidatorsTest(TestCase):
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
"""Tests for core exceptions and exception handler"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.exceptions import (
|
||||
AuthenticationError,
|
||||
BadRequestError,
|
||||
@@ -18,6 +16,7 @@ from apps.core.exceptions import (
|
||||
ServiceUnavailableError,
|
||||
ValidationError,
|
||||
)
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class BaseAPIExceptionTest(TestCase):
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
"""Tests for core filter utilities"""
|
||||
|
||||
from django.test import TestCase
|
||||
from django_filters import rest_framework as filters
|
||||
from rest_framework.filters import OrderingFilter, SearchFilter
|
||||
|
||||
from apps.core.filters import (
|
||||
BaseFilterSet,
|
||||
FilterMixin,
|
||||
@@ -11,6 +7,9 @@ from apps.core.filters import (
|
||||
StandardSearchFilter,
|
||||
get_filter_backends,
|
||||
)
|
||||
from django.test import TestCase
|
||||
from django_filters import rest_framework as filters
|
||||
from rest_framework.filters import OrderingFilter, SearchFilter
|
||||
|
||||
|
||||
class BaseFilterSetTest(TestCase):
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
from io import StringIO
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.external_data.models import (
|
||||
ArbitrationCase,
|
||||
IndustrialProduct,
|
||||
@@ -19,6 +16,8 @@ from apps.form_5.models import FormF5Record
|
||||
from apps.form_6.models import FormF6Record
|
||||
from apps.organization.models import Organization
|
||||
from apps.registers.models import RegisterUpload, RegistryMembershipPeriod
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class GenerateTestReportsCommandTest(TestCase):
|
||||
|
||||
@@ -4,13 +4,12 @@ import json
|
||||
import logging
|
||||
from io import StringIO
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.logging import (
|
||||
ContextLogger,
|
||||
JSONFormatter,
|
||||
get_json_logging_config,
|
||||
)
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class JSONFormatterTest(TestCase):
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
from io import StringIO
|
||||
|
||||
from apps.core.management.commands.base import BaseAppCommand
|
||||
from django.core.management.base import CommandError
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.management.commands.base import BaseAppCommand
|
||||
|
||||
|
||||
class TestCommand(BaseAppCommand):
|
||||
"""Тестовая команда для проверки BaseAppCommand."""
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
"""Тесты для Model Mixins."""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.mixins import (
|
||||
OrderableMixin,
|
||||
SoftDeleteMixin,
|
||||
StatusMixin,
|
||||
)
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class TimestampMixinTest(TestCase):
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
"""Tests for core OpenAPI utilities"""
|
||||
|
||||
from django.test import TestCase
|
||||
from drf_yasg import openapi
|
||||
from rest_framework import serializers
|
||||
|
||||
from apps.core.openapi import (
|
||||
CommonParameters,
|
||||
CommonResponses,
|
||||
@@ -11,6 +7,9 @@ from apps.core.openapi import (
|
||||
api_docs,
|
||||
paginated_response,
|
||||
)
|
||||
from django.test import TestCase
|
||||
from drf_yasg import openapi
|
||||
from rest_framework import serializers
|
||||
|
||||
|
||||
class DummySerializer(serializers.Serializer):
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
"""Tests for core permissions"""
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import RequestFactory, TestCase
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from apps.core.permissions import (
|
||||
IsAdmin,
|
||||
IsAdminOrReadOnly,
|
||||
@@ -13,6 +9,10 @@ from apps.core.permissions import (
|
||||
IsSuperuser,
|
||||
IsVerified,
|
||||
)
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import RequestFactory, TestCase
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from tests.apps.user.factories import UserFactory
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
"""Tests for core response wrapper"""
|
||||
|
||||
from django.test import TestCase
|
||||
from rest_framework import status
|
||||
|
||||
from apps.core.response import (
|
||||
api_created_response,
|
||||
api_error_response,
|
||||
@@ -10,6 +7,8 @@ from apps.core.response import (
|
||||
api_paginated_response,
|
||||
api_response,
|
||||
)
|
||||
from django.test import TestCase
|
||||
from rest_framework import status
|
||||
|
||||
|
||||
class APIResponseTest(TestCase):
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
"""Tests for core services"""
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.exceptions import NotFoundError
|
||||
from apps.core.services import BaseService
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import TestCase
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
"""Tests for core signals utilities"""
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db.models.signals import post_save, pre_save
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.signals import (
|
||||
SignalDispatcher,
|
||||
emit_password_changed,
|
||||
@@ -15,6 +11,10 @@ from apps.core.signals import (
|
||||
user_registered,
|
||||
user_verified,
|
||||
)
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db.models.signals import post_save, pre_save
|
||||
from django.test import TestCase
|
||||
|
||||
from tests.apps.user.factories import UserFactory
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
"""Tests for core Celery tasks"""
|
||||
|
||||
from celery import Task
|
||||
from django.test import TestCase
|
||||
|
||||
from apps.core.tasks import (
|
||||
BaseTask,
|
||||
IdempotentTask,
|
||||
@@ -10,6 +7,8 @@ from apps.core.tasks import (
|
||||
TimedTask,
|
||||
TransactionalTask,
|
||||
)
|
||||
from celery import Task
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class BaseTaskTest(TestCase):
|
||||
|
||||
@@ -4,14 +4,6 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.test import TestCase, override_settings
|
||||
from django.urls import include, path
|
||||
from rest_framework import serializers, status, viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from apps.core.pagination import StandardPagination
|
||||
from apps.core.viewsets import (
|
||||
BaseViewSet,
|
||||
@@ -21,6 +13,14 @@ from apps.core.viewsets import (
|
||||
)
|
||||
from apps.organization.models import Organization
|
||||
from apps.user.models import Profile, User
|
||||
from django.test import TestCase, override_settings
|
||||
from django.urls import include, path
|
||||
from rest_framework import serializers, status, viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from tests.apps.organization.factories import OrganizationFactory, fake
|
||||
from tests.apps.user.factories import ProfileFactory, UserFactory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user