Skip to content

Commit

Permalink
Fix serializer test
Browse files Browse the repository at this point in the history
  • Loading branch information
Janne Karjalainen committed Apr 8, 2021
1 parent fa34948 commit aa7d345
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/b2share_unit_tests/records/test_records_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
oaipmh_oai_dc, oaipmh_marc21_v1, datacite_v31, eudatcore_v1)
from invenio_indexer.api import RecordIndexer
from b2share.modules.records.minters import make_record_url
from b2share.modules.records.serializers.schemas.eudatcore import identifier_prefix

def make_record(test_records_data):
creator = create_user('creator')
Expand Down Expand Up @@ -266,10 +267,10 @@ def replace_refs(self):
assert [f.text for f in xml.xpath('//formats/format')] == \
list(set([f['key'].split('.')[1] for f in record['_files']]))
assert [i.text for i in xml.xpath('//alternateIdentifiers/alternateIdentifier')] == \
["{}:{}".format(i['alternate_identifier_type'], i['alternate_identifier'])\
["{}{}".format(identifier_prefix(i['alternate_identifier_type']), i['alternate_identifier'])\
for i in record['alternate_identifiers']]
assert [i.text for i in xml.xpath('//relatedIdentifiers/relatedIdentifier')] == \
["{}:{}".format(i['related_identifier_type'], i['related_identifier']) \
["{}{}".format(identifier_prefix(i['related_identifier_type']), i['related_identifier']) \
for i in record['related_identifiers']]
assert xml.xpath('//spatialCoverages/spatialCoverage/geoLocationPlace')[0].text == 'Turku'
assert xml.xpath('//spatialCoverages/spatialCoverage/geoLocationPoint/pointLongitude')[0]\
Expand Down

0 comments on commit aa7d345

Please sign in to comment.