diff --git a/swh/deposit/templates/deposit/content.xml b/swh/deposit/templates/deposit/content.xml --- a/swh/deposit/templates/deposit/content.xml +++ b/swh/deposit/templates/deposit/content.xml @@ -1,6 +1,15 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit" + > + {{ deposit_id }} + {{ request.date }} + {{ status }} + {{ status_detail }} + + {{ deposit_id }} {{ request.date }} {{ status }} diff --git a/swh/deposit/templates/deposit/deposit_receipt.xml b/swh/deposit/templates/deposit/deposit_receipt.xml --- a/swh/deposit/templates/deposit/deposit_receipt.xml +++ b/swh/deposit/templates/deposit/deposit_receipt.xml @@ -1,6 +1,15 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit" + > + {{ deposit_id }} + {{ deposit_date }} + {{ archive }} + {{ status }} + + {{ deposit_id }} {{ deposit_date }} {{ archive }} diff --git a/swh/deposit/templates/deposit/status.xml b/swh/deposit/templates/deposit/status.xml --- a/swh/deposit/templates/deposit/status.xml +++ b/swh/deposit/templates/deposit/status.xml @@ -1,9 +1,23 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit" + > + {{ deposit_id }} + {{ status }} + {{ status_detail }} + + {% if swhid is not None %}{{ swhid }}{% endif %} + {% if swhid_context is not None %}{{ swhid_context }}{% endif %} + {% if external_id is not None %}{{ external_id }}{% endif %} + + + {{ deposit_id }} {{ status }} {{ status_detail }} + {% if swhid is not None %}{{ swhid }}{% endif %} {% if swhid_context is not None %}{{ swhid_context }}{% endif %} {% if external_id is not None %}{{ external_id }}{% endif %} diff --git a/swh/deposit/tests/api/test_collection_post_binary.py b/swh/deposit/tests/api/test_collection_post_binary.py --- a/swh/deposit/tests/api/test_collection_post_binary.py +++ b/swh/deposit/tests/api/test_collection_post_binary.py @@ -119,6 +119,12 @@ assert deposit_request.raw_metadata is None response_content = parse_xml(BytesIO(response.content)) + + assert response_content["swh:deposit_archive"] == sample_archive["name"] + assert int(response_content["swh:deposit_id"]) == deposit.id + assert response_content["swh:deposit_status"] == deposit.status + + # deprecated tags assert response_content["deposit_archive"] == sample_archive["name"] assert int(response_content["deposit_id"]) == deposit.id assert response_content["deposit_status"] == deposit.status diff --git a/swh/deposit/tests/api/test_get_file.py b/swh/deposit/tests/api/test_get_file.py --- a/swh/deposit/tests/api/test_get_file.py +++ b/swh/deposit/tests/api/test_get_file.py @@ -32,7 +32,7 @@ assert response.status_code == status.HTTP_200_OK actual_deposit = dict(parse_xml(response.content)) del actual_deposit["deposit_date"] - assert actual_deposit == expected_deposit + assert set(actual_deposit.items()) >= set(expected_deposit.items()) def test_api_deposit_content_unknown(client, complete_deposit, deposit_collection): diff --git a/swh/deposit/tests/data/https_deposit.swh.test/1_test b/swh/deposit/tests/data/https_deposit.swh.test/1_test --- a/swh/deposit/tests/data/https_deposit.swh.test/1_test +++ b/swh/deposit/tests/data/https_deposit.swh.test/1_test @@ -1,6 +1,14 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit" + > + 615 + Oct. 8, 2020, 4:57 p.m. + None + partial + + 615 Oct. 8, 2020, 4:57 p.m. None diff --git a/swh/deposit/tests/data/https_deposit.test.metadata/1_test b/swh/deposit/tests/data/https_deposit.test.metadata/1_test --- a/swh/deposit/tests/data/https_deposit.test.metadata/1_test +++ b/swh/deposit/tests/data/https_deposit.test.metadata/1_test @@ -1,6 +1,14 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit" + > + 666 + Oct. 8, 2020, 4:57 p.m. + hardcoded_sample_archive_path + partial + + 666 Oct. 8, 2020, 4:57 p.m. hardcoded_sample_archive_path diff --git a/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata b/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata --- a/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata +++ b/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_metadata @@ -1,6 +1,13 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + 666 + Oct. 9, 2020, 8:44 p.m. + something + deposited + + 666 Oct. 9, 2020, 8:44 p.m. something