🐛(dependencies) modify expected details on 404 responses

djangorestframework released version 3.15.0, which includes modifications of
details upon returning 404 errors (see related issue
https://github.com/encode/django-rest-framework/pull/8051).

This commit changes the expected details of 404 responses in our tests,
to match DRF 3.15.0.
This commit is contained in:
Marie PUPO JEAMMET
2024-03-21 14:56:55 +01:00
committed by Marie
parent 2d0fb0ef70
commit 340ddf8b1a
4 changed files with 6 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ def test_api_team_accesses_retrieve_authenticated_unrelated():
f"/api/v1.0/teams/{access.team.id!s}/accesses/{access.id!s}/",
)
assert response.status_code == 404
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No TeamAccess matches the given query."}
# Accesses related to another team should be excluded even if the user is related to it
for other_access in [
@@ -54,7 +54,7 @@ def test_api_team_accesses_retrieve_authenticated_unrelated():
)
assert response.status_code == 404
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No TeamAccess matches the given query."}
def test_api_team_accesses_retrieve_authenticated_related():

View File

@@ -45,7 +45,7 @@ def test_api_teams_delete_authenticated_unrelated():
)
assert response.status_code == HTTP_404_NOT_FOUND
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No Team matches the given query."}
assert models.Team.objects.count() == 1

View File

@@ -38,7 +38,7 @@ def test_api_teams_retrieve_authenticated_unrelated():
f"/api/v1.0/teams/{team.id!s}/",
)
assert response.status_code == HTTP_404_NOT_FOUND
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No Team matches the given query."}
def test_api_teams_retrieve_authenticated_related():

View File

@@ -61,7 +61,7 @@ def test_api_teams_update_authenticated_unrelated():
)
assert response.status_code == HTTP_404_NOT_FOUND
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No Team matches the given query."}
team.refresh_from_db()
team_values = serializers.TeamSerializer(instance=team).data
@@ -188,7 +188,7 @@ def test_api_teams_update_administrator_or_owner_of_another():
)
assert response.status_code == HTTP_404_NOT_FOUND
assert response.json() == {"detail": "Not found."}
assert response.json() == {"detail": "No Team matches the given query."}
team.refresh_from_db()
team_values = serializers.TeamSerializer(instance=team).data