99from django .utils import timezone
1010import pytest
1111
12+ from dandiapi .api .services .metadata import get_default_license
13+
1214if TYPE_CHECKING :
1315 from rest_framework .test import APIClient
1416
@@ -725,7 +727,11 @@ def test_dandiset_rest_create_embargoed(api_client, user):
725727@pytest .mark .django_db
726728def test_dandiset_rest_create_embargoed_with_award_info (authenticated_api_client : APIClient ):
727729 name = 'Test Embargoed Dandiset'
728- metadata = {'name' : name , 'description' : 'Test embargoed dandiset' , 'license' : ['spdx:CC0-1.0' ]}
730+ metadata = {
731+ 'name' : name ,
732+ 'description' : 'Test embargoed dandiset' ,
733+ 'license' : [get_default_license ()],
734+ }
729735
730736 # Create embargoed dandiset with funding and award info
731737 embargo_end_date = (timezone .now ().date () + datetime .timedelta (days = 365 )).isoformat ()
@@ -771,7 +777,11 @@ def test_dandiset_rest_create_embargoed_with_award_info(authenticated_api_client
771777def test_dandiset_rest_create_embargoed_no_funding_info (authenticated_api_client : APIClient ):
772778 """Test creating embargoed dandiset with no funding source or award number (should succeed)."""
773779 name = 'Test Embargoed Dandiset - No Funding'
774- metadata = {'name' : name , 'description' : 'Test embargoed dandiset' , 'license' : ['spdx:CC0-1.0' ]}
780+ metadata = {
781+ 'name' : name ,
782+ 'description' : 'Test embargoed dandiset' ,
783+ 'license' : [get_default_license ()],
784+ }
775785
776786 # Create embargoed dandiset without funding info
777787 query_params = {'embargo' : 'true' }
@@ -814,7 +824,11 @@ def test_dandiset_rest_create_embargoed_no_funding_info(authenticated_api_client
814824def test_dandiset_rest_create_embargoed_funding_no_award (authenticated_api_client : APIClient ):
815825 """Test creating embargoed dandiset with funding source but no award number (should fail)."""
816826 name = 'Test Embargoed Dandiset - Funding Only'
817- metadata = {'name' : name , 'description' : 'Test embargoed dandiset' , 'license' : ['spdx:CC0-1.0' ]}
827+ metadata = {
828+ 'name' : name ,
829+ 'description' : 'Test embargoed dandiset' ,
830+ 'license' : [get_default_license ()],
831+ }
818832
819833 # Create embargoed dandiset with funding source but no award number
820834 query_params = {
@@ -832,7 +846,11 @@ def test_dandiset_rest_create_embargoed_funding_no_award(authenticated_api_clien
832846def test_dandiset_rest_create_embargoed_award_no_funding (authenticated_api_client : APIClient ):
833847 """Test creating embargoed dandiset with award number but no funding source (should fail)."""
834848 name = 'Test Embargoed Dandiset - Award Only'
835- metadata = {'name' : name , 'description' : 'Test embargoed dandiset' , 'license' : ['spdx:CC0-1.0' ]}
849+ metadata = {
850+ 'name' : name ,
851+ 'description' : 'Test embargoed dandiset' ,
852+ 'license' : [get_default_license ()],
853+ }
836854
837855 # Create embargoed dandiset with award number but no funding source
838856 query_params = {
0 commit comments