diff --git a/swh/deposit/api/common.py b/swh/deposit/api/common.py --- a/swh/deposit/api/common.py +++ b/swh/deposit/api/common.py @@ -853,8 +853,9 @@ if headers.slug and metadata["atom:external_identifier"] != headers.slug: raise DepositError( BAD_REQUEST, - "The 'external_identifier' tag is deprecated, " - "the Slug header should be used instead.", + "The tag and Slug header are deprecated, " + " or " + "should be used instead.", ) def _empty_post( diff --git a/swh/deposit/tests/api/test_collection_post_atom.py b/swh/deposit/tests/api/test_collection_post_atom.py --- a/swh/deposit/tests/api/test_collection_post_atom.py +++ b/swh/deposit/tests/api/test_collection_post_atom.py @@ -261,7 +261,10 @@ HTTP_SLUG="something", ) - assert b"The 'external_identifier' tag is deprecated" in response.content + assert ( + b"The <external_identifier> tag and Slug header are deprecated" + in response.content + ) assert response.status_code == status.HTTP_400_BAD_REQUEST