diff --git a/dandi/cli/tests/test_service_scripts.py b/dandi/cli/tests/test_service_scripts.py index 9c9ced5be..10a0a8713 100644 --- a/dandi/cli/tests/test_service_scripts.py +++ b/dandi/cli/tests/test_service_scripts.py @@ -9,7 +9,6 @@ import anys from click.testing import CliRunner -from dandischema.consts import DANDI_SCHEMA_VERSION from dandischema.models import ID_PATTERN import pytest @@ -104,18 +103,21 @@ def test_update_dandiset_from_doi( ) assert r.exit_code == 0 metadata = new_dandiset.dandiset.get_raw_metadata() + # The DANDI schema version in the metadata under test is the server's, + # not this client's. + server_schema_version = new_dandiset.client.get("/info/")["schema_version"] with (DATA_DIR / "update_dandiset_from_doi" / f"{name}.json").open() as fp: expected = json.load(fp) expected["id"] = anys.AnyFullmatch(rf"{ID_PATTERN}:{dandiset_id}/draft") expected["url"] = f"{repository}/dandiset/{dandiset_id}/draft" expected["@context"] = ( "https://raw.githubusercontent.com/dandi/schema/master/releases" - f"/{DANDI_SCHEMA_VERSION}/context.json" + f"/{server_schema_version}/context.json" ) expected["identifier"] = anys.AnyFullmatch(rf"{ID_PATTERN}:{dandiset_id}") expected["repository"] = repository expected["dateCreated"] = anys.ANY_AWARE_DATETIME_STR - expected["schemaVersion"] = DANDI_SCHEMA_VERSION + expected["schemaVersion"] = server_schema_version expected["wasGeneratedBy"][0]["id"] = anys.AnyFullmatch( r"urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" )