Skip to content

Commit

Permalink
Test getting record by DOI case-insensitively
Browse files Browse the repository at this point in the history
  • Loading branch information
marksparkza committed Oct 23, 2023
1 parent e57ab8b commit 9e57849
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/api/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def test_get_record(api, record_batch, scopes, collection_auth, record_ident):
if record_ident == 'id':
r = api(scopes, api_client_collections).get(f'/record/{record_batch[2].id}')
elif record_ident == 'doi':
if not (doi := record_batch[2].doi):
if not (doi := record_batch[2].doi.upper()): # case-insensitive DOI retrieval
return
r = api(scopes, api_client_collections).get(f'/record/doi/{doi}')

Expand Down Expand Up @@ -440,7 +440,7 @@ def test_create_record_conflict(api, record_batch_with_ids, is_admin_route, coll

if ident_conflict == 'doi':
record = record_build(
doi=record_batch_with_ids[0].doi.upper(), # DOIs are case-insensitive
doi=record_batch_with_ids[0].doi.upper(), # check for case-insensitive DOI collision
collection=new_record_collection,
)
elif ident_conflict == 'sid':
Expand Down Expand Up @@ -711,7 +711,7 @@ def test_update_record_conflict(api, record_batch_with_ids, is_admin_route, coll
if ident_conflict == 'doi':
record = record_build(
id=record_batch_with_ids[2].id,
doi=record_batch_with_ids[0].doi.upper(), # DOIs are case-insensitive
doi=record_batch_with_ids[0].doi.upper(), # check for case-insensitive DOI collision
collection=modified_record_collection,
)
elif ident_conflict == 'sid':
Expand Down

0 comments on commit 9e57849

Please sign in to comment.