From fb09b326d7d7a86bf4726c6449624e1431a63eba Mon Sep 17 00:00:00 2001 From: Fatimah Date: Mon, 22 Apr 2024 14:06:58 +0200 Subject: [PATCH] tests: updated dcat and datacite tests --- .../serializers/dcat/datacite-to-dcat-ap.xsl | 5 ++++- .../serializers/test_datacite_serializer.py | 16 ++++++++++++++-- .../serializers/test_dcat_serializer.py | 9 +++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/invenio_rdm_records/resources/serializers/dcat/datacite-to-dcat-ap.xsl b/invenio_rdm_records/resources/serializers/dcat/datacite-to-dcat-ap.xsl index 94b24da045..acfbdb405a 100644 --- a/invenio_rdm_records/resources/serializers/dcat/datacite-to-dcat-ap.xsl +++ b/invenio_rdm_records/resources/serializers/dcat/datacite-to-dcat-ap.xsl @@ -1655,7 +1655,10 @@ +--> + + + diff --git a/tests/resources/serializers/test_datacite_serializer.py b/tests/resources/serializers/test_datacite_serializer.py index 12a7432c95..01f2d73c2c 100644 --- a/tests/resources/serializers/test_datacite_serializer.py +++ b/tests/resources/serializers/test_datacite_serializer.py @@ -121,6 +121,7 @@ def test_datacite43_serializer(running_app, full_record_to_dict): { "nameIdentifier": "0000-0001-8135-3489", "nameIdentifierScheme": "ORCID", + "schemeUri": "http://orcid.org/", } ], "nameType": "Personal", @@ -144,6 +145,7 @@ def test_datacite43_serializer(running_app, full_record_to_dict): { "nameIdentifier": "0000-0001-8135-3489", "nameIdentifierScheme": "ORCID", + "schemeUri": "http://orcid.org/", } ], "nameType": "Personal", @@ -167,6 +169,10 @@ def test_datacite43_serializer(running_app, full_record_to_dict): "descriptionType": "Abstract", }, {"description": "Bla bla bla", "descriptionType": "Methods", "lang": "eng"}, + { + "description": '{"references": ["Nielsen et al,.."]}', + "descriptionType": "Other", + }, ], "formats": ["application/pdf"], "fundingReferences": [ @@ -224,6 +230,10 @@ def test_datacite43_serializer(running_app, full_record_to_dict): "rightsUri": "https://creativecommons.org/licenses/by/4.0/legalcode", }, {"rights": "No rightsUri license"}, + { + "rights": "Embargoed Access", + "rightsUri": "info:eu-repo/semantics/embargoedAccess", + }, ], "schemaVersion": "http://datacite.org/schema/kernel-4", "sizes": ["11 pages"], @@ -275,7 +285,7 @@ def test_datacite43_xml_serializer(running_app, full_record_to_dict): " Lars Holm\n" " Nielsen\n" " 0000-0001-8135-3489\n' + 'nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-8135-3489\n' " CERN\n" " free-text\n" " \n" @@ -303,7 +313,7 @@ def test_datacite43_xml_serializer(running_app, full_record_to_dict): " Lars Holm\n" " Nielsen\n" " 0000-0001-8135-3489\n' + 'nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-8135-3489\n' " CERN\n" " TU Wien\n" " \n" @@ -340,12 +350,14 @@ def test_datacite43_xml_serializer(running_app, full_record_to_dict): 'rightsURI="https://creativecommons.org/licenses/by/4.0/legalcode" ' 'rightsIdentifierScheme="spdx" rightsIdentifier="cc-by-4.0">Creative Commons ' "Attribution 4.0 International\n" + ' Embargoed Access\n' " \n" " \n" ' A description \n' "with HTML tags\n" ' Bla bla ' "bla\n" + ' {"references": ["Nielsen et al,.."]}\n' " \n" " \n" " \n" diff --git a/tests/resources/serializers/test_dcat_serializer.py b/tests/resources/serializers/test_dcat_serializer.py index cc6137b069..bc9c23db2e 100644 --- a/tests/resources/serializers/test_dcat_serializer.py +++ b/tests/resources/serializers/test_dcat_serializer.py @@ -40,6 +40,7 @@ def test_dcat_serializer(running_app, full_record_to_dict): " \n" ' \n' ' \n' + ' 0000-0001-8135-3489\n' " Nielsen, Lars Holm\n" " Lars Holm\n" " Nielsen\n" @@ -107,6 +108,7 @@ def test_dcat_serializer(running_app, full_record_to_dict): " \n" ' \n' ' \n' + ' 0000-0001-8135-3489\n' " Nielsen, Lars Holm\n" " Lars Holm\n" " Nielsen\n" @@ -181,6 +183,7 @@ def test_dcat_serializer(running_app, full_record_to_dict): " Bla bla bla\n" " \n" " \n" + ' {"references": ["Nielsen et al,.."]}\n' " \n" " \n" " \n' " \n" " \n" + ' \n' + " \n" + ' \n' + " Embargoed Access\n" + " \n" + " \n" " \n" " \n" " \n"