fix: serve latest organization analytics data
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 2m53s
CI/CD Pipeline / Code Quality Checks (push) Successful in 3m12s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 2m53s
CI/CD Pipeline / Code Quality Checks (push) Successful in 3m12s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
This commit is contained in:
@@ -9,6 +9,8 @@ from django.test import override_settings
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from tests.apps.external_data.factories import FinancialReportFactory
|
||||
from tests.apps.form_2.factories import FormF2RecordFactory
|
||||
from tests.apps.organization.factories import OrganizationFactory
|
||||
from tests.apps.user.factories import UserFactory
|
||||
|
||||
@@ -120,6 +122,20 @@ class OrganizationApiTest(APITestCase):
|
||||
"Иванов Иван Иванович",
|
||||
)
|
||||
|
||||
def test_detail_summary_uses_available_related_report_data(self):
|
||||
organization = OrganizationFactory.create(
|
||||
financial_reports_available=False,
|
||||
tax_reports_available=False,
|
||||
)
|
||||
FinancialReportFactory.create(organization=organization, status="success")
|
||||
FormF2RecordFactory.create(organization=organization, income_tax="1200.00")
|
||||
|
||||
response = self.client.get(f"/api/v1/organizations/{organization.id}/")
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
self.assertTrue(response.data["summary"]["financial_reports_available"])
|
||||
self.assertTrue(response.data["summary"]["tax_reports_available"])
|
||||
|
||||
def test_registry_filter_uses_only_active_memberships(self):
|
||||
active_organization = OrganizationFactory.create(name="АО Актив")
|
||||
closed_organization = OrganizationFactory.create(name="АО Закрыт")
|
||||
|
||||
Reference in New Issue
Block a user