Skip to content

Commit

Permalink
Update DataCite sample record and test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-saeon committed Jul 6, 2018
1 parent a4b578c commit c9aa9f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
5 changes: 3 additions & 2 deletions ckanext/metadata/tests/test_metadata_record_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,10 @@ def test_validate_datacite(self):
metadata_model = ckanext_factories.MetadataModel(
metadata_schema_id=metadata_record['metadata_schema_id'],
model_json=load_example('saeon_datacite_model.json'))
ckan_factories.Vocabulary(name='language-tags', tags=[{'name': 'en-us'}])

self._assert_metadata_record_has_validation_models(metadata_record['id'], metadata_model['name'])
self._test_action('metadata_record_validate', id=metadata_record['id'])
assert_package_has_extra(metadata_record['id'], 'validated', True)
# TODO: finalise exact structure of DataCite model; currently the sample record does not validate
# self._assert_validate_activity_logged(metadata_record['id'], metadata_model)
assert_package_has_extra(metadata_record['id'], 'errors', '{}')
self._assert_validate_activity_logged(metadata_record['id'], metadata_model)
22 changes: 9 additions & 13 deletions examples/saeon_datacite_record.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"additionalFields": {
"coverageBegin": "",
"coverageEnd": "",
"onlineResources": [
{"desc": "Original Metadata Record",
"func": "metadata",
"href": "http://qa.dirisa.org/Portals/test-mike/testcustmike/metadata/metadata.2018-02-28.9981326861/getOriginalXml",
"name": "Original Metadata Record"}],
"source_uri": "",
"status": "complete"
},
"onlineResources": [
{"desc": "Original Metadata Record",
"func": "metadata",
"href": "http://qa.dirisa.org/Portals/test-mike/testcustmike/metadata/metadata.2018-02-28.9981326861/getOriginalXml",
"name": "Original Metadata Record"}],
"alternateIdentifiers": [{
"alternateIdentifier": "http://schema.datacite.org/schema/meta/kernel-3.1/example/datacite-example-full-v3.1.xml",
"alternateIdentifierType": "URL"}],
Expand All @@ -32,7 +26,7 @@
"description": "XML example of all DataCite Metadata Schema v3.1 properties.",
"descriptionType": "Abstract"}],
"errors": [],
"formats": ["application/xml"],
"formats": [{"format": "application/xml"}],
"geoLocations": [{
"geoLocationBox": "41.090 -71.032 42.893 -68.211",
"geoLocationPlace": "Atlantic Ocean",
Expand Down Expand Up @@ -64,7 +58,9 @@
"rights": "CC0 1.0 Universal",
"rightsURI": "http://creativecommons.org/publicdomain/zero/1.0/"}],
"schemaSpecific": {},
"sizes": ["3KB", "25ml"],
"sizes": [
{"size": "3KB"},
{"size": "25ml"}],
"subjects": [{
"schemeURI": "http://dewey.info/",
"subject": "000 computer science",
Expand Down

0 comments on commit c9aa9f4

Please sign in to comment.