diff --git a/api/internal/tests/views/test_owner_viewset.py b/api/internal/tests/views/test_owner_viewset.py index 144f9d88f7..be80f569c1 100644 --- a/api/internal/tests/views/test_owner_viewset.py +++ b/api/internal/tests/views/test_owner_viewset.py @@ -1,6 +1,7 @@ from unittest.mock import patch from rest_framework import status +from rest_framework.exceptions import ErrorDetail from rest_framework.reverse import reverse from rest_framework.test import APITestCase @@ -50,11 +51,19 @@ def test_retrieve_returns_owner_with_period_username(self): def test_retrieve_returns_404_if_no_matching_username(self): response = self._retrieve(kwargs={"service": "github", "owner_username": "fff"}) assert response.status_code == status.HTTP_404_NOT_FOUND - assert response.data == {"detail": "Not found."} + assert response.data == { + "detail": ErrorDetail( + string="No Owner matches the given query.", code="not_found" + ) + } def test_retrieve_owner_unknown_service_returns_404(self): response = self._retrieve( kwargs={"service": "not-real", "owner_username": "anything"} ) assert response.status_code == status.HTTP_404_NOT_FOUND - assert response.data == {"detail": "Service not found: not-real"} + assert response.data == { + "detail": ErrorDetail( + string="Service not found: not-real", code="not_found" + ) + } diff --git a/api/public/v2/tests/test_api_owner_viewset.py b/api/public/v2/tests/test_api_owner_viewset.py index 9f0d95b842..a46b8252a6 100644 --- a/api/public/v2/tests/test_api_owner_viewset.py +++ b/api/public/v2/tests/test_api_owner_viewset.py @@ -1,4 +1,5 @@ from rest_framework import status +from rest_framework.exceptions import ErrorDetail from rest_framework.reverse import reverse from rest_framework.test import APITestCase @@ -37,7 +38,11 @@ def test_retrieve_returns_owner_with_period_username(self): def test_retrieve_returns_404_if_no_matching_username(self): response = self._retrieve(kwargs={"service": "github", "owner_username": "fff"}) assert response.status_code == status.HTTP_404_NOT_FOUND - assert response.data == {"detail": "Not found."} + assert response.data == { + "detail": ErrorDetail( + string="No Owner matches the given query.", code="not_found" + ) + } def test_retrieve_owner_unknown_service_returns_404(self): response = self._retrieve( diff --git a/requirements.in b/requirements.in index 3e4ae3349f..601ad9b962 100644 --- a/requirements.in +++ b/requirements.in @@ -12,7 +12,7 @@ django-filter django-model-utils django-postgres-extra>=2.0.8 django-prometheus -djangorestframework +djangorestframework==3.15.2 drf-spectacular drf-spectacular-sidecar elastic-apm @@ -54,3 +54,4 @@ vcrpy whitenoise django-autocomplete-light django-better-admin-arrayfield +certifi>=2024.07.04 diff --git a/requirements.txt b/requirements.txt index e2ed0d9f45..807c4f1868 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,8 +57,9 @@ cerberus==1.3.2 # via # -r requirements.in # shared -certifi==2023.7.22 +certifi==2024.7.4 # via + # -r requirements.in # elastic-apm # httpcore # httpx @@ -148,7 +149,7 @@ django-prometheus==2.3.1 # via # -r requirements.in # shared -djangorestframework==3.14.0 +djangorestframework==3.15.2 # via # -r requirements.in # drf-spectacular @@ -377,7 +378,6 @@ python-redis-lock==4.0.0 pytz==2022.1 # via # -r requirements.in - # djangorestframework # shared pyyaml==6.0.1 # via