fix(api/tests): order expected test_attachment_serializer_remote_file alphabetically
This commit is contained in:
parent
f72f222d6b
commit
b20bfe3ac2
|
@ -216,25 +216,25 @@ def test_attachment_serializer_remote_file(factories, to_api_date):
|
||||||
attachment = factories["common.Attachment"](file=None)
|
attachment = factories["common.Attachment"](file=None)
|
||||||
proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": attachment.uuid})
|
proxy_url = reverse("api:v1:attachments-proxy", kwargs={"uuid": attachment.uuid})
|
||||||
expected = {
|
expected = {
|
||||||
"uuid": str(attachment.uuid),
|
|
||||||
"size": attachment.size,
|
|
||||||
"mimetype": attachment.mimetype,
|
|
||||||
"creation_date": to_api_date(attachment.creation_date),
|
"creation_date": to_api_date(attachment.creation_date),
|
||||||
|
"mimetype": attachment.mimetype,
|
||||||
|
"size": attachment.size,
|
||||||
# everything is the same, except for the urls field because:
|
# everything is the same, except for the urls field because:
|
||||||
# - the file isn't available on the local pod
|
# - the file isn't available on the local pod
|
||||||
# - we need to return different URLs so that the client can trigger
|
# - we need to return different URLs so that the client can trigger
|
||||||
# a fetch and get redirected to the desired version
|
# a fetch and get redirected to the desired version
|
||||||
#
|
#
|
||||||
"urls": {
|
"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(
|
"large_square_crop": federation_utils.full_url(
|
||||||
proxy_url + "?next=large_square_crop"
|
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)
|
serializer = serializers.AttachmentSerializer(attachment)
|
||||||
|
|
Loading…
Reference in New Issue