Skip to content

Commit

Permalink
[vuln patch] Bump certifi and djangorestframework (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitvinnakota-codecov authored Jul 15, 2024
1 parent ec5df79 commit fd9acc0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
13 changes: 11 additions & 2 deletions api/internal/tests/views/test_owner_viewset.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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"
)
}
7 changes: 6 additions & 1 deletion api/public/v2/tests/test_api_owner_viewset.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,3 +54,4 @@ vcrpy
whitenoise
django-autocomplete-light
django-better-admin-arrayfield
certifi>=2024.07.04
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -377,7 +378,6 @@ python-redis-lock==4.0.0
pytz==2022.1
# via
# -r requirements.in
# djangorestframework
# shared
pyyaml==6.0.1
# via
Expand Down

0 comments on commit fd9acc0

Please sign in to comment.