Skip to content

Commit

Permalink
marshmallow: clean up migrated schema classes and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Panero authored and ppanero committed Oct 20, 2020
1 parent a25ce3a commit f6b38b6
Show file tree
Hide file tree
Showing 14 changed files with 311 additions and 997 deletions.
49 changes: 14 additions & 35 deletions invenio_rdm_records/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,20 @@ def create_fake_record():
fake = Faker()
data_to_use = {
"access": {
"metadata_restricted": False,
"files_restricted": False,
"owners": [1],
"metadata": False,
"files": False,
"owned_by": [1],
"access_right": "open",
"created_by": 1,
"embargo_date":
fake.future_date(end_date='+1y').strftime("%Y-%m-%d")
},
"metadata": {
"resource_type": fake_resource_type(),
"identifiers": {
"DOI": "10.9999/rdm.9999999",
"arXiv": "9999.99999",
},
"creators": [{
"name": fake.name(),
"type": "Personal",
"type": "personal",
"identifiers": {
"Orcid": "0000-0002-1825-0097",
"orcid": "0000-0002-1825-0097",
},
"affiliations": [{
"name": fake.company(),
Expand All @@ -98,11 +95,7 @@ def create_fake_record():
}
}]
}],
"titles": [{
"title": fake.company() + "'s gallery",
"type": "Other",
"lang": "eng"
}],
"title": fake.company() + "'s gallery",
"publication_date": fake_edtf_level_0(),
"subjects": [{
"subject": "Romans",
Expand All @@ -111,7 +104,7 @@ def create_fake_record():
}],
"contributors": [{
"name": fake.name(),
"type": "Personal",
"type": "personal",
"affiliations": [{
"name": fake.company(),
"identifiers": {
Expand All @@ -126,25 +119,21 @@ def create_fake_record():
"description": "Random test date",
"type": "Other"
}],
"language": "eng",
"languages": ["eng"],
"related_identifiers": [{
"identifier": "10.9999/rdm.9999988",
"scheme": "DOI",
"relation_type": "Requires",
"resource_type": fake_resource_type()
}],
"version": "v0.0.1",
"licenses": [{
"rights": [{
"license": "Berkeley Software Distribution 3",
"uri": "https://opensource.org/licenses/BSD-3-Clause",
"identifier": "BSD-3",
"scheme": "BSD-3",
}],
"descriptions": [{
"description": fake.text(max_nb_chars=3000),
"type": "Abstract",
"lang": "eng"
}],
"description": fake.text(max_nb_chars=3000),
"locations": [{
"point": {
"lat": str(fake.latitude()),
Expand All @@ -154,20 +143,10 @@ def create_fake_record():
"description": "Random place on land for random coordinates..."
}],
"references": [{
"reference_string": "Reference to something et al.",
"reference": "Reference to something et al.",
"identifier": "9999.99988",
"scheme": "GRID"
}],
"embargo_date": (
fake.future_date(end_date='+1y').strftime("%Y-%m-%d")
),
"contact": "info@inveniosoftware.org",
"_default_preview": "previewer one",
"_internal_notes": [{
"user": "inveniouser",
"note": "RDM record",
"timestamp": fake.date(pattern='%Y-%m-%d')
}],
}]
}
}

Expand Down
13 changes: 0 additions & 13 deletions invenio_rdm_records/marshmallow/__init__.py

This file was deleted.

0 comments on commit f6b38b6

Please sign in to comment.