diff --git a/site/cds_rdm/inspire_harvester/transform/mappers/identifiers.py b/site/cds_rdm/inspire_harvester/transform/mappers/identifiers.py index 0ada59df..fea3c74e 100644 --- a/site/cds_rdm/inspire_harvester/transform/mappers/identifiers.py +++ b/site/cds_rdm/inspire_harvester/transform/mappers/identifiers.py @@ -204,7 +204,7 @@ def map_value(self, src_record, ctx, logger): "scheme": "inspire", "identifier": ctx.inspire_id, "relation_type": {"id": "isvariantformof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": ctx.resource_type.value}, } ) diff --git a/site/tests/inspire_harvester/conftest.py b/site/tests/inspire_harvester/conftest.py index 9cf631f4..f91b1eed 100644 --- a/site/tests/inspire_harvester/conftest.py +++ b/site/tests/inspire_harvester/conftest.py @@ -62,7 +62,7 @@ def transformed_record_no_files(): "identifier": "1695540", "scheme": "inspire", "relation_type": {"id": "isversionof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "publication-dissertation"}, } ], }, diff --git a/site/tests/inspire_harvester/test_harvester_job.py b/site/tests/inspire_harvester/test_harvester_job.py index 298770e9..58915139 100644 --- a/site/tests/inspire_harvester/test_harvester_job.py +++ b/site/tests/inspire_harvester/test_harvester_job.py @@ -93,10 +93,10 @@ }, }, "resource_type": { - "id": "publication-other", + "id": "publication-dissertation", "title": { "de": "Abschlussarbeit", - "en": "Other", + "en": "Thesis", }, }, "scheme": "inspire", @@ -196,10 +196,10 @@ }, }, "resource_type": { - "id": "publication-other", + "id": "publication-dissertation", "title": { "de": "Abschlussarbeit", - "en": "Other", + "en": "Thesis", }, }, "scheme": "inspire", @@ -275,10 +275,10 @@ }, }, "resource_type": { - "id": "publication-other", + "id": "publication-dissertation", "title": { "de": "Abschlussarbeit", - "en": "Other", + "en": "Thesis", }, }, "scheme": "inspire", diff --git a/site/tests/inspire_harvester/test_transformer.py b/site/tests/inspire_harvester/test_transformer.py index 9b1911af..48e9867b 100644 --- a/site/tests/inspire_harvester/test_transformer.py +++ b/site/tests/inspire_harvester/test_transformer.py @@ -74,7 +74,7 @@ def test_transform_related_identifiers(mock_normalize_isbn, running_app): "identifier": "12345", "scheme": "inspire", "relation_type": {"id": "isvariantformof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "other"}, } in result assert { "identifier": "978-0-123456-78-9", diff --git a/site/tests/inspire_harvester/test_update_create_logic.py b/site/tests/inspire_harvester/test_update_create_logic.py index 6bdd7ac8..15b145a4 100644 --- a/site/tests/inspire_harvester/test_update_create_logic.py +++ b/site/tests/inspire_harvester/test_update_create_logic.py @@ -49,13 +49,7 @@ def test_new_non_CDS_record( "en": "is variant of", }, }, - "resource_type": { - "id": "publication-other", - "title": { - "de": "Abschlussarbeit", - "en": "Other", - }, - }, + "resource_type": created_record["metadata"]["resource_type"], } ] assert created_record["metadata"]["identifiers"] == [ @@ -147,7 +141,7 @@ def test_update_record_with_CDS_DOI_one_doc_type( "identifier": "2707794", "scheme": "inspire", "relation_type": {"id": "isvariantformof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "publication-preprint"}, } in new_version.data["metadata"]["related_identifiers"] # clean up for other tests diff --git a/site/tests/inspire_harvester/test_writer.py b/site/tests/inspire_harvester/test_writer.py index a28c9edd..a0157862 100644 --- a/site/tests/inspire_harvester/test_writer.py +++ b/site/tests/inspire_harvester/test_writer.py @@ -44,7 +44,7 @@ def transformed_record_1_file(scope="function"): "identifier": "2685275", "scheme": "inspire", "relation_type": {"id": "isversionof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "publication-dissertation"}, } ], }, @@ -85,7 +85,7 @@ def transformed_record_2_files(): "identifier": "2685275", "scheme": "inspire", "relation_type": {"id": "isversionof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "publication-dissertation"}, } ], }, @@ -208,7 +208,7 @@ def test_writer_2_records( "identifier": "1793973", "scheme": "inspire", "relation_type": {"id": "isversionof"}, - "resource_type": {"id": "publication-other"}, + "resource_type": {"id": "publication-dissertation"}, } ], },