diff --git a/swh/storage/tests/test_storage.py b/swh/storage/tests/test_storage.py --- a/swh/storage/tests/test_storage.py +++ b/swh/storage/tests/test_storage.py @@ -2791,14 +2791,14 @@ provider['id'], tool['id'], data.origin_metadata2['metadata']) - all_metadatas = list(swh_storage.origin_metadata_get_by( - origin_id)) + all_metadatas = list(sorted(swh_storage.origin_metadata_get_by( + origin_id), key=lambda x: x['discovery_date'])) metadatas_for_origin2 = list(swh_storage.origin_metadata_get_by( origin_id2)) expected_results = [{ 'origin_id': origin_id, 'discovery_date': datetime.datetime( - 2017, 1, 1, 23, 0, + 2015, 1, 1, 23, 0, tzinfo=datetime.timezone.utc), 'metadata': { 'name': 'test_origin_metadata', @@ -2812,7 +2812,7 @@ }, { 'origin_id': origin_id, 'discovery_date': datetime.datetime( - 2015, 1, 1, 23, 0, + 2017, 1, 1, 23, 0, tzinfo=datetime.timezone.utc), 'metadata': { 'name': 'test_origin_metadata',