@@ -25,17 +25,26 @@ def test_datacite_rdm_conversion(full_datacite43_record, full_rdm_record):
2525
2626def test_datacite_rdm_create_edit (full_datacite43_record ):
2727 env_token = os .environ .get ("RDMTOK" )
28- doi = caltechdata_write (
28+
29+ # Remove DOI from full_datacite43_record
30+ # since we want the test system to create one
31+ identifiers = []
32+ for identifier in full_datacite43_record ["identifiers" ]:
33+ if identifier ["identifierType" ] != "DOI" :
34+ identifiers .append (identifier )
35+ full_datacite43_record ["identifiers" ] = identifiers
36+
37+ recid = caltechdata_write (
2938 full_datacite43_record ,
3039 schema = "43" ,
3140 production = False ,
3241 publish = True ,
3342 token = env_token ,
3443 )
3544
36- assert doi . startswith ( "10.33569" )
45+ assert len ( recid ) == 11
3746
38- doi = caltechdata_write (
47+ recid = caltechdata_write (
3948 full_datacite43_record ,
4049 schema = "43" ,
4150 production = False ,
@@ -44,19 +53,12 @@ def test_datacite_rdm_create_edit(full_datacite43_record):
4453 token = env_token ,
4554 )
4655
47- assert doi .startswith ("10.33569" )
48-
49- # If we don't publish, don't get back a DOI
50- idv = caltechdata_write (
51- full_datacite43_record , schema = "43" , production = False , token = env_token
52- )
53-
54- assert idv .startswith ("10.33569" ) == False
56+ assert len (recid ) == 11
5557
5658 full_datacite43_record ["publisher" ] = "Edited"
5759
5860 doi = caltechdata_edit (
59- idv ,
61+ recid ,
6062 full_datacite43_record ,
6163 schema = "43" ,
6264 production = False ,
@@ -65,16 +67,16 @@ def test_datacite_rdm_create_edit(full_datacite43_record):
6567 )
6668
6769 assert doi .startswith ("10.33569" )
68- idv = doi .split ("/" )[1 ]
6970
70- new_metadata = get_metadata (idv , production = False , publish = True )
71+ # Validate is false until geolocation points are fixed/we move to 4.6
72+ new_metadata = get_metadata (recid , production = False , validate = False )
7173
7274 assert new_metadata ["publisher" ] == "Edited"
7375
7476 full_datacite43_record ["publisher" ] = "Again!"
7577
7678 new_doi = caltechdata_edit (
77- idv ,
79+ recid ,
7880 full_datacite43_record ,
7981 files = ["codemeta.json" ],
8082 schema = "43" ,
@@ -85,8 +87,9 @@ def test_datacite_rdm_create_edit(full_datacite43_record):
8587
8688 assert new_doi != doi
8789
88- idv = new_doi .split ("/" )[1 ]
90+ recid = new_doi .split ("/" )[1 ]
8991
90- new_metadata = get_metadata (idv , production = False )
92+ # Validate is false until geolocation points are fixed/we move to 4.6
93+ new_metadata = get_metadata (recid , production = False , validate = False )
9194
9295 assert new_metadata ["publisher" ] == "Again!"
0 commit comments