From a88d2f49fe38052c214a926cdb12583bcab11bba Mon Sep 17 00:00:00 2001 From: Pablo Tamarit Date: Tue, 17 Dec 2024 17:04:59 +0100 Subject: [PATCH] serializers: bibtex: Conference paper not falling back to proceedings --- .../resources/serializers/bibtex/schema.py | 1 - tests/resources/serializers/test_bibtex_serializer.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/invenio_rdm_records/resources/serializers/bibtex/schema.py b/invenio_rdm_records/resources/serializers/bibtex/schema.py index e80f2aa28..2f055ad73 100644 --- a/invenio_rdm_records/resources/serializers/bibtex/schema.py +++ b/invenio_rdm_records/resources/serializers/bibtex/schema.py @@ -46,7 +46,6 @@ class BibTexSchema(BaseSerializerSchema, CommonFieldsMixin): # Publication fields "publication-conferencepaper": [ BibTexFormatter.in_proceedings, - BibTexFormatter.proceedings, ], "publication-book": [ BibTexFormatter.book, 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.