From 288af91d1f3f20f046c01cd1c9d45e43899c9e83 Mon Sep 17 00:00:00 2001 From: Pablo Tamarit Date: Wed, 18 Dec 2024 10:22:14 +0100 Subject: [PATCH] serializers: bibtex: Conference paper not falling back to proceedings --- .../resources/serializers/bibtex/schema.py | 5 +---- tests/resources/serializers/test_bibtex_serializer.py | 10 ++++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/invenio_rdm_records/resources/serializers/bibtex/schema.py b/invenio_rdm_records/resources/serializers/bibtex/schema.py index e80f2aa28..761363fd2 100644 --- a/invenio_rdm_records/resources/serializers/bibtex/schema.py +++ b/invenio_rdm_records/resources/serializers/bibtex/schema.py @@ -44,10 +44,7 @@ class BibTexSchema(BaseSerializerSchema, CommonFieldsMixin): entry_mapper = { # Publication fields - "publication-conferencepaper": [ - BibTexFormatter.in_proceedings, - BibTexFormatter.proceedings, - ], + "publication-conferencepaper": [BibTexFormatter.in_proceedings], "publication-book": [ BibTexFormatter.book, BibTexFormatter.booklet, diff --git a/tests/resources/serializers/test_bibtex_serializer.py b/tests/resources/serializers/test_bibtex_serializer.py index 5d2d54610..171bf82a7 100644 --- a/tests/resources/serializers/test_bibtex_serializer.py +++ b/tests/resources/serializers/test_bibtex_serializer.py @@ -149,7 +149,7 @@ def test_serialize_publication_conferencepaper(running_app, updated_minimal_reco It serializes into the following formats, depending on the data: - inproceedings - - proceedings + - misc """ updated_minimal_record["metadata"]["resource_type"][ "id" @@ -178,23 +178,25 @@ def test_serialize_publication_conferencepaper(running_app, updated_minimal_reco assert serialized_record == expected_data - # Force serialization into 'proceedings' + # Force serialization into 'misc' del updated_minimal_record["custom_fields"]["imprint:imprint"] serialized_record = serializer.serialize_object(updated_minimal_record) expected_data = "\n".join( [ - "@proceedings{brown_2023_abcde-fghij,", + "@misc{brown_2023_abcde-fghij,", " author = {Name and", " Troy Inc.},", " title = {A Romans story},", + " month = mar,", " year = 2023,", " publisher = {Acme Inc},", - " month = mar,", "}", ] ) + assert serialized_record == expected_data + def test_serialize_publication_book(running_app, updated_minimal_record): """Test bibtex formatter for books.