feat(registry): add new endpoints for registers, exchange, and backups; update routing and configurations
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 3m10s
CI/CD Pipeline / Run Tests (push) Successful in 3m35s
CI/CD Pipeline / Telegram Notify Success (push) Has been skipped
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m26s
CI/CD Pipeline / Run Tests (pull_request) Successful in 2m46s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 3m10s
CI/CD Pipeline / Run Tests (push) Successful in 3m35s
CI/CD Pipeline / Telegram Notify Success (push) Has been skipped
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m26s
CI/CD Pipeline / Run Tests (pull_request) Successful in 2m46s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
This commit is contained in:
@@ -6,13 +6,13 @@ import io
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from apps.parsers.models import FinancialReport, FinancialReportLine, ProcurementRecord
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.urls import reverse
|
||||
from openpyxl import Workbook
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from apps.parsers.models import FinancialReport, FinancialReportLine, ProcurementRecord
|
||||
from tests.apps.parsers.factories import (
|
||||
IndustrialCertificateRecordFactory,
|
||||
InspectionRecordFactory,
|
||||
@@ -34,7 +34,9 @@ def _build_fns_excel_bytes() -> bytes:
|
||||
year = fake.random_int(min=2020, max=2025)
|
||||
ws.append(["Form", None, year, None])
|
||||
ws.append([None, "Code", "Start", "End"])
|
||||
ws.append([fake.word(), _digits(4), fake.random_int(10, 999), fake.random_int(10, 999)])
|
||||
ws.append(
|
||||
[fake.word(), _digits(4), fake.random_int(10, 999), fake.random_int(10, 999)]
|
||||
)
|
||||
buf = io.BytesIO()
|
||||
wb.save(buf)
|
||||
wb.close()
|
||||
@@ -130,6 +132,7 @@ class ParsersViewSetTest(APITestCase):
|
||||
url = reverse("api_v1:fns:fns-reports-list")
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(response.data["data"][0]["lines_count"], 1)
|
||||
detail = self.client.get(
|
||||
reverse("api_v1:fns:fns-reports-detail", args=[report.id])
|
||||
)
|
||||
@@ -184,5 +187,7 @@ class ParsersViewSetTest(APITestCase):
|
||||
FNS_FAILED_DIRECTORY=failed_dir,
|
||||
):
|
||||
url = reverse("api_v1:fns:fns-upload")
|
||||
response = self.client.post(url, {"files": [upload]}, format="multipart")
|
||||
response = self.client.post(
|
||||
url, {"files": [upload]}, format="multipart"
|
||||
)
|
||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
Reference in New Issue
Block a user