🐛(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:
committed by
Marie
parent
2d0fb0ef70
commit
340ddf8b1a
@@ -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}/",
|
f"/api/v1.0/teams/{access.team.id!s}/accesses/{access.id!s}/",
|
||||||
)
|
)
|
||||||
assert response.status_code == 404
|
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
|
# Accesses related to another team should be excluded even if the user is related to it
|
||||||
for other_access in [
|
for other_access in [
|
||||||
@@ -54,7 +54,7 @@ def test_api_team_accesses_retrieve_authenticated_unrelated():
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == 404
|
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():
|
def test_api_team_accesses_retrieve_authenticated_related():
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def test_api_teams_delete_authenticated_unrelated():
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == HTTP_404_NOT_FOUND
|
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
|
assert models.Team.objects.count() == 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ def test_api_teams_retrieve_authenticated_unrelated():
|
|||||||
f"/api/v1.0/teams/{team.id!s}/",
|
f"/api/v1.0/teams/{team.id!s}/",
|
||||||
)
|
)
|
||||||
assert response.status_code == HTTP_404_NOT_FOUND
|
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():
|
def test_api_teams_retrieve_authenticated_related():
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ def test_api_teams_update_authenticated_unrelated():
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert response.status_code == HTTP_404_NOT_FOUND
|
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.refresh_from_db()
|
||||||
team_values = serializers.TeamSerializer(instance=team).data
|
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.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.refresh_from_db()
|
||||||
team_values = serializers.TeamSerializer(instance=team).data
|
team_values = serializers.TeamSerializer(instance=team).data
|
||||||
|
|||||||
Reference in New Issue
Block a user