Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serializers: bibtex: Conference paper not falling back to proceedings #1917

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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,
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 @@ -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"
Expand Down Expand Up @@ -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.},",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the this part of the test did NOT have an assertion, and that the expected data was not correct (proceedings do NOT have an author).

" 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.
Expand Down
Loading