Skip to content

Commit

Permalink
fix datetime not accepting years
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed May 29, 2024
1 parent bbfd613 commit 844ccea
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 75 deletions.
4 changes: 2 additions & 2 deletions easyDataverse/classgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date
from datetime import date, datetime
import forge
import types
import re
Expand All @@ -17,7 +17,7 @@
"integer": int,
"int": int,
"textbox": str,
"date": date,
"date": str,
"email": EmailStr,
}

Expand Down
148 changes: 76 additions & 72 deletions tests/fixtures/minimal_upload.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,79 @@
{
"datasetVersion": {
"metadataBlocks": {
"citation": {
"fields": [
{
"multiple": true,
"typeClass": "compound",
"typeName": "author",
"value": [
{
"authorName": {
"multiple": false,
"typeClass": "primitive",
"typeName": "authorName",
"value": "John Doe"
}
}
]
},
{
"multiple": true,
"typeClass": "compound",
"typeName": "datasetContact",
"value": [
{
"datasetContactName": {
"multiple": false,
"typeClass": "primitive",
"typeName": "datasetContactName",
"value": "John Doe"
},
"datasetContactEmail": {
"multiple": false,
"typeClass": "primitive",
"typeName": "datasetContactEmail",
"value": "[email protected]"
}
}
]
},
{
"multiple": true,
"typeClass": "compound",
"typeName": "dsDescription",
"value": [
{
"dsDescriptionValue": {
"multiple": false,
"typeClass": "primitive",
"typeName": "dsDescriptionValue",
"value": "This is a description of the dataset"
}
}
]
},
{
"multiple": true,
"typeClass": "controlledVocabulary",
"typeName": "subject",
"value": [
"Other"
]
},
{
"multiple": false,
"typeClass": "primitive",
"typeName": "title",
"value": "My dataset"
}
]
}
}
"datasetVersion": {
"metadataBlocks": {
"citation": {
"fields": [
{
"multiple": true,
"typeClass": "compound",
"typeName": "author",
"value": [
{
"authorName": {
"multiple": false,
"typeClass": "primitive",
"typeName": "authorName",
"value": "John Doe"
}
}
]
},
{
"multiple": true,
"typeClass": "compound",
"typeName": "datasetContact",
"value": [
{
"datasetContactName": {
"multiple": false,
"typeClass": "primitive",
"typeName": "datasetContactName",
"value": "John Doe"
},
"datasetContactEmail": {
"multiple": false,
"typeClass": "primitive",
"typeName": "datasetContactEmail",
"value": "[email protected]"
}
}
]
},
{
"multiple": true,
"typeClass": "compound",
"typeName": "dsDescription",
"value": [
{
"dsDescriptionValue": {
"multiple": false,
"typeClass": "primitive",
"typeName": "dsDescriptionValue",
"value": "This is a description of the dataset"
},
"dsDescriptionDate": {
"multiple": false,
"typeClass": "primitive",
"typeName": "dsDescriptionDate",
"value": "2024"
}
}
]
},
{
"multiple": true,
"typeClass": "controlledVocabulary",
"typeName": "subject",
"value": ["Other"]
},
{
"multiple": false,
"typeClass": "primitive",
"typeName": "title",
"value": "My dataset"
}
]
}
}
}
}
3 changes: 2 additions & 1 deletion tests/integration/test_dataset_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def test_creation(
dataset.citation.subject = ["Other"]
dataset.citation.add_author(name="John Doe")
dataset.citation.add_ds_description(
value="This is a description of the dataset"
value="This is a description of the dataset",
date="2024",
)
dataset.citation.add_dataset_contact(
name="John Doe",
Expand Down

0 comments on commit 844ccea

Please sign in to comment.