Skip to content

Commit

Permalink
dependencies: upper pinned types requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo committed Oct 12, 2023
1 parent 9109f00 commit dd58b37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invenio_rdm_records/resources/serializers/schemaorg/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def get_publication_date(self, obj):

def get_modification_date(self, obj):
"""Get modification date."""
# TODO: implement with the help of test data
return missing
last_updated = obj.get("updated")
return last_updated or missing

def get_language(self, obj):
"""Get language. Schemaorg expects either a string or language dict.
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ install_requires =
pytz>=2020.4
pyyaml>=5.4.0
python-slugify>=8.0.1
# Upper pinning due to commonmeta-py
types-requests<2.31.0.7

[options.extras_require]
tests =
Expand Down
5 changes: 5 additions & 0 deletions tests/resources/serializers/test_schemaorg_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def test_schemaorg_serializer_full_record(running_app, full_record):
serializer = SchemaorgJSONLDSerializer()
serialized_record = serializer.dump_obj(full_record)

assert serialized_record["dateModified"]

# Delete to facilitate the comparison with the expected data
del serialized_record["dateModified"]

assert serialized_record == expected_data


Expand Down

0 comments on commit dd58b37

Please sign in to comment.