From b20bfe3ac25ec5b3c8da9a63b67b78be11560846 Mon Sep 17 00:00:00 2001 From: jon r Date: Sat, 22 Feb 2025 19:09:03 +0100 Subject: [PATCH] fix(api/tests): order expected test_attachment_serializer_remote_file alphabetically --- api/tests/common/test_serializers.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/tests/common/test_serializers.py b/api/tests/common/test_serializers.py index 39941a297..5bd739e44 100644 --- a/api/tests/common/test_serializers.py +++ b/api/tests/common/test_serializers.py @@ -216,25 +216,25 @@ def test_attachment_serializer_remote_file(factories, to_api_date): attachment = factories["common.Attachment"](file=None) proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": attachment.uuid}) expected = { - "uuid": str(attachment.uuid), - "size": attachment.size, - "mimetype": attachment.mimetype, "creation_date": to_api_date(attachment.creation_date), + "mimetype": attachment.mimetype, + "size": attachment.size, # everything is the same, except for the urls field because: # - the file isn't available on the local pod # - we need to return different URLs so that the client can trigger # a fetch and get redirected to the desired version # "urls": { - "source": attachment.url, - "original": federation_utils.full_url(proxy_url + "?next=original"), - "medium_square_crop": federation_utils.full_url( - proxy_url + "?next=medium_square_crop" - ), "large_square_crop": federation_utils.full_url( proxy_url + "?next=large_square_crop" ), + "medium_square_crop": federation_utils.full_url( + proxy_url + "?next=medium_square_crop" + ), + "original": federation_utils.full_url(proxy_url + "?next=original"), + "source": attachment.url, }, + "uuid": str(attachment.uuid), } serializer = serializers.AttachmentSerializer(attachment)