Skip to content

Commit

Permalink
bibtex: add trailing comma in url field
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo authored and slint committed Dec 9, 2024
1 parent 35e968f commit 911f7e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion invenio_rdm_records/resources/serializers/bibtex/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _format_output_row(self, field, value):
elif field == "month":
out = " {0:<12} = {1},\n".format(field, value)
elif field == "url":
out = " {0:<12} = {{{1}}}\n".format(field, value)
out = " {0:<12} = {{{1}}},\n".format(field, value)
else:
if not isinstance(value, list) and value.isdigit():
out = " {0:<12} = {1},\n".format(field, value)
Expand Down
20 changes: 10 additions & 10 deletions tests/resources/serializers/test_bibtex_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_bibtex_serializer_full_record(running_app, updated_full_record):
" publisher = {InvenioRDM},\n"
" version = {v1.0},\n"
" doi = {10.1234/12345-abcde},\n"
" url = {https://doi.org/10.1234/12345-abcde}\n"
" url = {https://doi.org/10.1234/12345-abcde},\n"
"}"
)

Expand Down Expand Up @@ -151,9 +151,9 @@ def test_serialize_publication_conferencepaper(running_app, updated_minimal_reco
- inproceedings
- proceedings
"""
updated_minimal_record["metadata"]["resource_type"][
"id"
] = "publication-conferencepaper"
updated_minimal_record["metadata"]["resource_type"]["id"] = (
"publication-conferencepaper"
)

# Force serialization into 'inproceedings'
updated_minimal_record.update(
Expand Down Expand Up @@ -341,9 +341,9 @@ def test_serialize_publication_technicalnote(running_app, updated_minimal_record
It serializes into 'manual'.
"""
updated_minimal_record["metadata"]["resource_type"][
"id"
] = "publication-technicalnote"
updated_minimal_record["metadata"]["resource_type"]["id"] = (
"publication-technicalnote"
)

serializer = BibtexSerializer()
serialized_record = serializer.serialize_object(updated_minimal_record)
Expand All @@ -368,9 +368,9 @@ def test_serialize_publication_workingpaper(running_app, updated_minimal_record)
It serializes into 'unpublished'.
"""
updated_minimal_record["metadata"]["resource_type"][
"id"
] = "publication-workingpaper"
updated_minimal_record["metadata"]["resource_type"]["id"] = (
"publication-workingpaper"
)

updated_minimal_record.update(
{
Expand Down

0 comments on commit 911f7e0

Please sign in to comment.