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 17, 2024
1 parent 834976d commit 156ee65
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 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,9 @@ 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 156ee65

Please sign in to comment.