From 6a8d77ee4b55186aa3b4580e629664a9dc7b5eae Mon Sep 17 00:00:00 2001 From: SeSo Date: Tue, 24 Dec 2024 11:20:15 -0800 Subject: [PATCH 1/3] fix: fix api docs endpoint Signed-off-by: SeSo --- bc_obps/reporting/api/report_activity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bc_obps/reporting/api/report_activity.py b/bc_obps/reporting/api/report_activity.py index e07177956f..20d79ef429 100644 --- a/bc_obps/reporting/api/report_activity.py +++ b/bc_obps/reporting/api/report_activity.py @@ -9,7 +9,7 @@ from reporting.schema.report_activity_data import ReportActivityDataIn from reporting.service.report_activity_load_service import ReportActivityLoadService from reporting.service.report_activity_save_service import ReportActivitySaveService -from service.error_service import custom_codes_4xx +from service.error_service.custom_codes_4xx import custom_codes_4xx from .router import router From 24562908d24c9f1819160e1ad5d8e31bcb52eb5b Mon Sep 17 00:00:00 2001 From: SeSo Date: Tue, 24 Dec 2024 11:20:46 -0800 Subject: [PATCH 2/3] test: add regression test Signed-off-by: SeSo --- bc_obps/common/tests/endpoints/test_openapi_docs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bc_obps/common/tests/endpoints/test_openapi_docs.py diff --git a/bc_obps/common/tests/endpoints/test_openapi_docs.py b/bc_obps/common/tests/endpoints/test_openapi_docs.py new file mode 100644 index 0000000000..c0f9cfe67e --- /dev/null +++ b/bc_obps/common/tests/endpoints/test_openapi_docs.py @@ -0,0 +1,12 @@ +from django.test import Client, TestCase +from registration.utils import custom_reverse_lazy + + +class TestOpenAPIDocs(TestCase): + """ + Tests that the OpenAPI docs are accessible. + """ + def test_openapi_docs_are_accessible(self): + client = Client() + response = client.get(custom_reverse_lazy('openapi-json')) + self.assertEqual(response.status_code, 200) \ No newline at end of file From 64347da06fb96d7daf694b953d218b2ffa6becb4 Mon Sep 17 00:00:00 2001 From: SeSo Date: Tue, 24 Dec 2024 13:19:24 -0800 Subject: [PATCH 3/3] chore: make pre-commit happy --- bc_obps/common/tests/endpoints/test_openapi_docs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bc_obps/common/tests/endpoints/test_openapi_docs.py b/bc_obps/common/tests/endpoints/test_openapi_docs.py index c0f9cfe67e..f64a366b73 100644 --- a/bc_obps/common/tests/endpoints/test_openapi_docs.py +++ b/bc_obps/common/tests/endpoints/test_openapi_docs.py @@ -6,7 +6,8 @@ class TestOpenAPIDocs(TestCase): """ Tests that the OpenAPI docs are accessible. """ + def test_openapi_docs_are_accessible(self): client = Client() response = client.get(custom_reverse_lazy('openapi-json')) - self.assertEqual(response.status_code, 200) \ No newline at end of file + self.assertEqual(response.status_code, 200)