diff --git a/api_tests/files/views/test_file_list.py b/api_tests/files/views/test_file_list.py index 6c59a36a218..24034c911ef 100644 --- a/api_tests/files/views/test_file_list.py +++ b/api_tests/files/views/test_file_list.py @@ -123,20 +123,11 @@ def test_disambiguate_dataverse_paths_initial(self, app, user, node, dataverse): ) data = res.json['data'] assert len(data) == 2 - assert data[0]['attributes']['extra'] == { - 'datasetVersion': 'latest', - 'hashes': { - 'md5': None, - 'sha256': None - } - } - assert data[1]['attributes']['extra'] == { - 'datasetVersion': 'latest-published', - 'hashes': { - 'md5': None, - 'sha256': None - } + dataset_versions = { + _datum['attributes']['extra']['datasetVersion'] + for _datum in data } + assert dataset_versions == {'latest', 'latest-published'} @responses.activate def test_disambiguate_dataverse_paths_retrieve(self, app, user, node, dataverse, dataverse_draft_filenode, dataverse_published_filenode): @@ -155,7 +146,6 @@ def test_disambiguate_dataverse_paths_retrieve(self, app, user, node, dataverse, 'path': '/testpath', 'materialized': '/testpath', 'kind': 'file', - 'extra': { 'datasetVersion': 'latest', }, @@ -179,20 +169,11 @@ def test_disambiguate_dataverse_paths_retrieve(self, app, user, node, dataverse, ) data = res.json['data'] assert len(data) == 2 - assert data[0]['attributes']['extra'] == { - 'datasetVersion': 'latest', - 'hashes': { - 'md5': None, - 'sha256': None - } - } - assert data[1]['attributes']['extra'] == { - 'datasetVersion': 'latest-published', - 'hashes': { - 'md5': None, - 'sha256': None - } + dataset_versions = { + _datum['attributes']['extra']['datasetVersion'] + for _datum in data } + assert dataset_versions == {'latest', 'latest-published'} @pytest.mark.django_db