Add book section serialization to bibtex #5836
Annotations
3 errors
Run tests:
tests/resources/serializers/test_bibtex_serializer.py#L1
Black format check
--- /home/runner/work/invenio-rdm-records/invenio-rdm-records/tests/resources/serializers/test_bibtex_serializer.py 2025-01-06 22:47:36.491845+00:00
+++ /home/runner/work/invenio-rdm-records/invenio-rdm-records/tests/resources/serializers/test_bibtex_serializer.py 2025-01-06 22:58:32.974274+00:00
@@ -192,21 +192,20 @@
" month = mar,",
"}",
]
)
+
def test_serialize_publication_booksection(running_app, updated_minimal_record):
"""Test bibtex formatter for a section of a book.
It serializes into `incollection` based on
- incollection
- inbook
"""
- updated_minimal_record["metadata"]["resource_type"][
- "id"
- ] = "publication-section"
+ updated_minimal_record["metadata"]["resource_type"]["id"] = "publication-section"
# Force serialization into 'inproceedings'
updated_minimal_record.update(
{"custom_fields": {"imprint:imprint": {"title": "book title"}}}
)
@@ -245,10 +244,11 @@
"}",
]
)
assert serialized_record == expected_data
+
def test_serialize_publication_book(running_app, updated_minimal_record):
"""Test bibtex formatter for books.
It serializes into the following formats, depending on the data:
|
Run tests:
tests/resources/serializers/test_bibtex_serializer.py#L249
test_serialize_publication_booksection
AssertionError: assert '@misc{brown_...Acme Inc},\n}' == '@inBook{brow... = mar,\n}'
- @inBook{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,
}
|
Run tests
Process completed with exit code 1.
|
Loading