Skip to content

Commit

Permalink
serializers: bibtex: Conference paper not falling back to proceedings
Browse files Browse the repository at this point in the history
  • Loading branch information
ptamarit authored and tmorrell committed Jan 9, 2025
1 parent 7e94694 commit 87ee1ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 1 addition & 4 deletions invenio_rdm_records/resources/serializers/bibtex/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ class BibTexSchema(BaseSerializerSchema, CommonFieldsMixin):

entry_mapper = {
# Publication fields
"publication-conferencepaper": [
BibTexFormatter.in_proceedings,
BibTexFormatter.proceedings,
],
"publication-conferencepaper": [BibTexFormatter.in_proceedings],
"publication-conferenceproceeding": [BibTexFormatter.proceedings],
"publication-book": [
BibTexFormatter.book,
Expand Down
10 changes: 6 additions & 4 deletions tests/resources/serializers/test_bibtex_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,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"
Expand Down Expand Up @@ -179,23 +179,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_conferenceproceeding(
running_app, updated_minimal_record
Expand Down

0 comments on commit 87ee1ac

Please sign in to comment.