from __future__ import annotations

from django.test import TestCase, override_settings
from rest_framework.test import APIClient


@override_settings(ROOT_URLCONF="economy.urls")
class EconomicOverviewApiTests(TestCase):
    def setUp(self):
        self.client = APIClient()

    def test_economic_overview_api_returns_service_unavailable_without_real_data(self):
        response = self.client.post(
            "/overview/",
            data={"farm_uuid": "550e8400-e29b-41d4-a716-446655440000"},
            format="json",
        )

        self.assertEqual(response.status_code, 503)
        self.assertIsNone(response.json()["data"])
