From 2749a88704b11d48c4e33d19f5e198b8aadcec8b Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 5 Jan 2025 01:36:41 +0100 Subject: [PATCH] Basic test for internal calendar --- com/tests/test_api.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/com/tests/test_api.py b/com/tests/test_api.py index cfc0e35f..f131052e 100644 --- a/com/tests/test_api.py +++ b/com/tests/test_api.py @@ -106,3 +106,17 @@ class TestExternalCalendar: assert f.read() == external_response.value assert mock_request.call_count == 2 + + +@pytest.mark.django_db +class TestInternalCalendar: + @pytest.fixture(autouse=True) + def clear_cache(self): + IcsCalendar._INTERNAL_CALENDAR.unlink(missing_ok=True) + + def test_fetch_success(self, client: Client): + response = client.get(reverse("api:calendar_internal")) + assert response.status_code == 200 + out_file = accel_redirect_to_file(response) + assert out_file is not None + assert out_file.exists()