Skip to content

Commit

Permalink
serializers: bibtex: Conference proceeding to proceedings
Browse files Browse the repository at this point in the history
  • Loading branch information
ptamarit committed Dec 18, 2024
1 parent 834976d commit a4760a8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions invenio_rdm_records/resources/serializers/bibtex/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class BibTexSchema(BaseSerializerSchema, CommonFieldsMixin):
BibTexFormatter.in_proceedings,
BibTexFormatter.proceedings,
],
"publication-conferenceproceeding": [BibTexFormatter.proceedings],
"publication-book": [
BibTexFormatter.book,
BibTexFormatter.booklet,
Expand Down
29 changes: 28 additions & 1 deletion tests/resources/serializers/test_bibtex_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def test_bibtex_serializer_full_record(running_app, updated_full_record):
("publication"),
("publication-annotationcollection"),
("publication-section"),
("publication-conferenceproceeding"),
("publication-datamanagementplan"),
("publication-journal"),
("publication-patent"),
Expand Down Expand Up @@ -196,6 +195,34 @@ def test_serialize_publication_conferencepaper(running_app, updated_minimal_reco
)


def test_serialize_publication_conferenceproceeding(
running_app, updated_minimal_record
):
"""Test bibtex formatter for conference proceedings.
It serializes into 'proceedings'.
"""
updated_minimal_record["metadata"]["resource_type"][
"id"
] = "publication-conferenceproceeding"

serializer = BibtexSerializer()
serialized_record = serializer.serialize_object(updated_minimal_record)

expected_data = "\n".join(
[
"@proceedings{brown_2023_abcde-fghij,",
" title = {A Romans story},",
" 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

0 comments on commit a4760a8

Please sign in to comment.