From 42ae75067b5468bb192ff92300d35f94deae4f91 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 10:53:02 +0000 Subject: [PATCH 01/20] Make the default image rendition background colour white but allow transparent --- etna/articles/models.py | 8 ++++++-- etna/collections/models.py | 2 +- etna/core/blocks/image.py | 9 +++++++-- etna/core/serializers/images.py | 9 ++++++--- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/etna/articles/models.py b/etna/articles/models.py index 3ba41b36a..b12675b13 100755 --- a/etna/articles/models.py +++ b/etna/articles/models.py @@ -560,7 +560,9 @@ class Meta(Orderable.Meta): class GallerySerializer(serializers.ModelSerializer): - image = HighlightImageSerializer(rendition_size="max-1024x1024") + image = HighlightImageSerializer( + rendition_size="max-1024x1024", background_colour=None + ) caption = RichTextSerializer() class Meta: @@ -759,7 +761,9 @@ class Meta: APIField("promoted_links"), APIField( "intro_image", - serializer=ImageSerializer(rendition_size="width-400"), + serializer=ImageSerializer( + rendition_size="width-400", background_colour=None + ), ), ] + TopicalPageMixin.api_fields diff --git a/etna/collections/models.py b/etna/collections/models.py index 04d38ad7c..ea0ff5d78 100644 --- a/etna/collections/models.py +++ b/etna/collections/models.py @@ -761,7 +761,7 @@ def highlight_image_count(self): class HighlightSerializer(serializers.ModelSerializer): - image = HighlightImageSerializer(rendition_size="max-1024x1024") + image = HighlightImageSerializer(rendition_size="max-1024x1024", background_colour=None) class Meta: model = Highlight diff --git a/etna/core/blocks/image.py b/etna/core/blocks/image.py index e42a71251..02c7ba01a 100644 --- a/etna/core/blocks/image.py +++ b/etna/core/blocks/image.py @@ -34,16 +34,21 @@ def __init__( rendition_size="fill-600x400", jpeg_quality=60, webp_quality=60, + background_colour="fff", **kwargs, ): + self.rendition_size = rendition_size self.jpeg_quality = jpeg_quality self.webp_quality = webp_quality - self.rendition_size = rendition_size + self.background_colour = background_colour super().__init__(required=required, help_text=help_text, **kwargs) def get_api_representation(self, value, context=None): serializer = DetailedImageSerializer( - self.rendition_size, self.jpeg_quality, self.webp_quality + rendition_size=self.rendition_size, + jpeg_quality=self.jpeg_quality, + webp_quality=self.webp_quality, + background_colour=self.background_colour, ) return serializer.to_representation(value) diff --git a/etna/core/serializers/images.py b/etna/core/serializers/images.py index 8eaa6f01b..8c80fa4c2 100644 --- a/etna/core/serializers/images.py +++ b/etna/core/serializers/images.py @@ -29,23 +29,26 @@ def __init__( rendition_size="fill-600x400", jpeg_quality=60, webp_quality=60, + background_colour="fff", additional_formats=[], *args, **kwargs, ): + self.rendition_size = rendition_size self.jpeg_quality = jpeg_quality self.webp_quality = webp_quality - self.rendition_size = rendition_size + self.background_colour = background_colour self.additional_formats = additional_formats super().__init__(*args, **kwargs) def to_representation(self, value): if value: + background_colour_redition = f"|bgcolor-{self.background_colour}" if self.background_colour else '' jpeg_image = value.get_rendition( - f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}" + f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}{background_colour_redition}" ) webp_image = value.get_rendition( - f"{self.rendition_size}|format-webp|webpquality-{self.webp_quality}" + f"{self.rendition_size}|format-webp|webpquality-{self.webp_quality}{background_colour_redition}" ) additional_images = {} From b228bd211e5039a278fb1396d3a91d7f013a6bbb Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 12:21:11 +0000 Subject: [PATCH 02/20] Black formatting --- etna/collections/models.py | 4 +++- etna/core/serializers/images.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/etna/collections/models.py b/etna/collections/models.py index ea0ff5d78..11985973a 100644 --- a/etna/collections/models.py +++ b/etna/collections/models.py @@ -761,7 +761,9 @@ def highlight_image_count(self): class HighlightSerializer(serializers.ModelSerializer): - image = HighlightImageSerializer(rendition_size="max-1024x1024", background_colour=None) + image = HighlightImageSerializer( + rendition_size="max-1024x1024", background_colour=None + ) class Meta: model = Highlight diff --git a/etna/core/serializers/images.py b/etna/core/serializers/images.py index 8c80fa4c2..29d467a65 100644 --- a/etna/core/serializers/images.py +++ b/etna/core/serializers/images.py @@ -43,7 +43,9 @@ def __init__( def to_representation(self, value): if value: - background_colour_redition = f"|bgcolor-{self.background_colour}" if self.background_colour else '' + background_colour_redition = ( + f"|bgcolor-{self.background_colour}" if self.background_colour else "" + ) jpeg_image = value.get_rendition( f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}{background_colour_redition}" ) From 47cba3d54d3eae782f882ba6a18482f55a78e776 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 12:29:53 +0000 Subject: [PATCH 03/20] Update tests --- etna/api/tests/expected_results/article.json | 16 ++-- .../tests/expected_results/article_index.json | 24 ++--- etna/api/tests/expected_results/author.json | 8 +- .../expected_results/focused_article.json | 8 +- .../expected_results/highlight_gallery.json | 16 ++-- etna/api/tests/expected_results/pages.json | 88 +++++++++---------- etna/api/tests/expected_results/people.json | 24 ++--- 7 files changed, 92 insertions(+), 92 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index 3cceec567..f26041fad 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -153,14 +153,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.webp", + "url": "/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 }, @@ -257,14 +257,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.webp", + "url": "/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/example_0Tm3K5n.max-900x900.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 }, diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index 06595742d..ce0ef29d3 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -80,14 +80,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -113,14 +113,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -139,14 +139,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index a3f98a7bf..1925851de 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -129,14 +129,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index 65d01b54c..7094c2b53 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -215,14 +215,14 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index c1ff63ff0..31fbc6216 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -103,14 +103,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.webp", + "url": "/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 }, @@ -138,14 +138,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/pages.json b/etna/api/tests/expected_results/pages.json index 619d6ba20..6977d02d6 100644 --- a/etna/api/tests/expected_results/pages.json +++ b/etna/api/tests/expected_results/pages.json @@ -24,14 +24,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -49,14 +49,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -75,14 +75,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -100,14 +100,14 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -125,14 +125,14 @@ "id": 8, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -150,14 +150,14 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -168,14 +168,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -184,14 +184,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -217,14 +217,14 @@ "id": 11, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -242,14 +242,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -268,14 +268,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index fb6712c32..b26195cf4 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -86,14 +86,14 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -104,14 +104,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -120,14 +120,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } From da849d988a071be60a2e7910564b62e0085ef0b3 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 12:39:38 +0000 Subject: [PATCH 04/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index be69a3b71..a10120434 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,14 +373,14 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - expected_data = re.sub(r"0_[a-zA-Z0-9]{6,7}", "0", expected_data) - api_data = re.sub(r"0_[a-zA-Z0-9]{6,7}", "0", api_data) - expected_data = re.sub(r"e_[a-zA-Z0-9]{6,7}", "e", expected_data) - api_data = re.sub(r"e_[a-zA-Z0-9]{6,7}", "e", api_data) - expected_data = re.sub(r"l_[a-zA-Z0-9]{6,7}", "l", expected_data) - api_data = re.sub(r"l_[a-zA-Z0-9]{6,7}", "l", api_data) - expected_data = re.sub(r"p_[a-zA-Z0-9]{6,7}", "p", expected_data) - api_data = re.sub(r"p_[a-zA-Z0-9]{6,7}", "p", api_data) + expected_data = re.sub(r"0_[a-fA-F0-9]{6,8}", "0", expected_data) + api_data = re.sub(r"0_[a-fA-F0-9]{6,8}", "0", api_data) + expected_data = re.sub(r"e_[a-fA-F0-9]{6,8}", "e", expected_data) + api_data = re.sub(r"e_[a-fA-F0-9]{6,8}", "e", api_data) + expected_data = re.sub(r"l_[a-fA-F0-9]{6,8}", "l", expected_data) + api_data = re.sub(r"l_[a-fA-F0-9]{6,8}", "l", api_data) + expected_data = re.sub(r"p_[a-fA-F0-9]{6,8}", "p", expected_data) + api_data = re.sub(r"p_[a-fA-F0-9]{6,8}", "p", api_data) self.assertEqual(expected_data, api_data) From e2ea8f62154b1c1dd3cccb54f3501afb8a76c0cc Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:05:19 +0000 Subject: [PATCH 05/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index a10120434..c6ffa347a 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,14 +373,8 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - expected_data = re.sub(r"0_[a-fA-F0-9]{6,8}", "0", expected_data) - api_data = re.sub(r"0_[a-fA-F0-9]{6,8}", "0", api_data) - expected_data = re.sub(r"e_[a-fA-F0-9]{6,8}", "e", expected_data) - api_data = re.sub(r"e_[a-fA-F0-9]{6,8}", "e", api_data) - expected_data = re.sub(r"l_[a-fA-F0-9]{6,8}", "l", expected_data) - api_data = re.sub(r"l_[a-fA-F0-9]{6,8}", "l", api_data) - expected_data = re.sub(r"p_[a-fA-F0-9]{6,8}", "p", expected_data) - api_data = re.sub(r"p_[a-fA-F0-9]{6,8}", "p", api_data) + expected_data = re.sub(r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", expected_data) + api_data = re.sub(r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", api_data) self.assertEqual(expected_data, api_data) From 2c794ae9961a4d0b1a93dcbb2ef0bbed61362a3d Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:07:37 +0000 Subject: [PATCH 06/20] Black formatting --- etna/api/tests/test_pages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index c6ffa347a..179b8c1ca 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,7 +373,9 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - expected_data = re.sub(r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", expected_data) + expected_data = re.sub( + r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", expected_data + ) api_data = re.sub(r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", api_data) self.assertEqual(expected_data, api_data) From 45a4b645c5ef24b083175d409632aad77862fbc9 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:18:20 +0000 Subject: [PATCH 07/20] Add background_colour to HighlightCardSerializer and update test regex --- etna/api/tests/test_pages.py | 7 +++---- etna/collections/models.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index 179b8c1ca..df10ccafd 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,10 +373,9 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - expected_data = re.sub( - r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", expected_data - ) - api_data = re.sub(r"_[a-zA-Z]{2,}\.[a-fA-F0-9]{6,8}", "", api_data) + regex = r"(_[a-zA-Z]{,2})?\.[a-fA-F0-9]{6,8}" + expected_data = re.sub(regex, "", expected_data) + api_data = re.sub(regex, "", api_data) self.assertEqual(expected_data, api_data) diff --git a/etna/collections/models.py b/etna/collections/models.py index 11985973a..c662f7e68 100644 --- a/etna/collections/models.py +++ b/etna/collections/models.py @@ -784,6 +784,7 @@ class HighlightCardSerializer(serializers.Serializer): rendition_size = "fill-600x400" jpeg_quality = 60 webp_quality = 60 + background_colour = "fff" additional_formats = [] def to_representation(self, value): From 616f76a35907e9323b0eff35873fda12d2cd319e Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:26:54 +0000 Subject: [PATCH 08/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index df10ccafd..d53e765f5 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,9 +373,10 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - regex = r"(_[a-zA-Z]{,2})?\.[a-fA-F0-9]{6,8}" - expected_data = re.sub(regex, "", expected_data) - api_data = re.sub(regex, "", api_data) + regex = r"/media/images/[a-zA-Z_]+\.[a-fA-F0-9]{6,8}" + replace = "/media/images/image" + expected_data = re.sub(regex, replace, expected_data) + api_data = re.sub(regex, replace, api_data) self.assertEqual(expected_data, api_data) From 5ff2879208206c769ccde21cb3e144a91b75cb8e Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:31:50 +0000 Subject: [PATCH 09/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index d53e765f5..aea9d1eb0 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,7 +373,7 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - regex = r"/media/images/[a-zA-Z_]+\.[a-fA-F0-9]{6,8}" + regex = r"/media/images/[a-zA-Z0-9_]+\.[a-fA-F0-9]{6,8}" replace = "/media/images/image" expected_data = re.sub(regex, replace, expected_data) api_data = re.sub(regex, replace, api_data) From 5597665dd61f82ced844a2cbef871111df141e39 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:42:38 +0000 Subject: [PATCH 10/20] Fix random image rendition IDs in tests --- etna/api/tests/expected_results/article.json | 24 +++++++------- .../tests/expected_results/article_index.json | 8 ++--- etna/api/tests/expected_results/arts.json | 24 +++++++------- etna/api/tests/expected_results/author.json | 8 ++--- .../tests/expected_results/early_modern.json | 28 ++++++++-------- .../expected_results/focused_article.json | 32 +++++++++---------- .../expected_results/highlight_gallery.json | 24 +++++++------- etna/api/tests/expected_results/people.json | 8 ++--- etna/api/tests/expected_results/postwar.json | 20 ++++++------ etna/api/tests/test_pages.py | 12 ++++--- 10 files changed, 96 insertions(+), 92 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index f26041fad..b2261d23c 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -28,8 +28,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -348,8 +348,8 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -375,14 +375,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } @@ -406,8 +406,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_yuGViLV.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_yuGViLV.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index ce0ef29d3..80253b4f0 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -28,8 +28,8 @@ "id": 11, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index 6515e8d7f..20379bb58 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -28,8 +28,8 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -88,8 +88,8 @@ "id": 3, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_hUehTut.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_hUehTut.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -153,8 +153,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -181,14 +181,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_USJnKya.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_USJnKya.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_zRNQgeA.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_zRNQgeA.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index 1925851de..891ca7001 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -28,8 +28,8 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index ee1c5075c..f910b95d7 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -28,8 +28,8 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -73,8 +73,8 @@ "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_VQVfGTV.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_VQVfGTV.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", "width": 100, "height": 40 }, @@ -94,8 +94,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_XBKOSWE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_XBKOSWE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 }, @@ -152,8 +152,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -180,14 +180,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_USJnKya.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_USJnKya.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_zRNQgeA.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_zRNQgeA.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index 7094c2b53..0d3dac6b6 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -28,8 +28,8 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -95,8 +95,8 @@ "id": 15, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_KklEhEZ.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_KklEhEZ.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -132,8 +132,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -161,8 +161,8 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -188,14 +188,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } @@ -255,8 +255,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60_igefotD.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60_igefotD.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index 31fbc6216..6f1e52f97 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -28,8 +28,8 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -82,8 +82,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -165,8 +165,8 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -192,14 +192,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_uNQeuSn.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_hHTWoNv.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index b26195cf4..faefa0dfb 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -28,8 +28,8 @@ "id": 8, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index d5bfed899..389c26a70 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -28,8 +28,8 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", "width": 100, "height": 100 } @@ -67,14 +67,14 @@ "id": 7, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_ydOnZpg.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_ydOnZpg.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_oHYAsUO.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_oHYAsUO.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", "width": 100, "height": 40 }, @@ -126,8 +126,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index aea9d1eb0..d5020ad2f 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,10 +373,14 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - regex = r"/media/images/[a-zA-Z0-9_]+\.[a-fA-F0-9]{6,8}" - replace = "/media/images/image" - expected_data = re.sub(regex, replace, expected_data) - api_data = re.sub(regex, replace, api_data) + regex_start = r"/media/images/[a-zA-Z0-9_]+\.[a-fA-F0-9]{6,8}\." + replace_end = "/media/images/image." + expected_data = re.sub(regex_start, replace_end, expected_data) + api_data = re.sub(regex_start, replace_end, api_data) + regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9])+_[a-zA-Z]*\.(jpg|webp)" + regex_replace_end = r"\.format-\g<1>\.\g<2>-\g<3>\.\g<4>" + expected_data = re.sub(regex_end, regex_replace_end, expected_data) + api_data = re.sub(regex_end, regex_replace_end, api_data) self.assertEqual(expected_data, api_data) From 225b9f8665565ecfc59c171e62d84baf263190be Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:48:24 +0000 Subject: [PATCH 11/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index d5020ad2f..b5dfda318 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -377,7 +377,7 @@ def compare_json(self, path: str, json_file: str): replace_end = "/media/images/image." expected_data = re.sub(regex_start, replace_end, expected_data) api_data = re.sub(regex_start, replace_end, api_data) - regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9])+_[a-zA-Z]*\.(jpg|webp)" + regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9])+[a-zA-Z0-9_]*\.(jpg|webp)" regex_replace_end = r"\.format-\g<1>\.\g<2>-\g<3>\.\g<4>" expected_data = re.sub(regex_end, regex_replace_end, expected_data) api_data = re.sub(regex_end, regex_replace_end, api_data) From 558ab751eb4741b4ab9c46e07713b1e1102060ce Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:50:04 +0000 Subject: [PATCH 12/20] Fix random image rendition IDs in tests --- etna/api/tests/expected_results/article.json | 48 +++++++++---------- .../tests/expected_results/article_index.json | 8 ++-- etna/api/tests/expected_results/arts.json | 32 ++++++------- etna/api/tests/expected_results/author.json | 24 +++++----- .../tests/expected_results/early_modern.json | 28 +++++------ .../expected_results/focused_article.json | 40 ++++++++-------- .../expected_results/highlight_gallery.json | 16 +++---- etna/api/tests/expected_results/people.json | 8 ++-- etna/api/tests/expected_results/postwar.json | 20 ++++---- etna/api/tests/test_pages.py | 2 +- 10 files changed, 113 insertions(+), 113 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index b2261d23c..090485dbb 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -74,14 +74,14 @@ "id": 13, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_ritOk5w.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_ritOk5w.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_xM6LhM0.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_xM6LhM0.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", "width": 100, "height": 40 }, @@ -95,14 +95,14 @@ "id": 13, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_tz03Hkv.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_tz03Hkv.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_BEZm7Hv.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_BEZm7Hv.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 }, @@ -189,14 +189,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_8oKXAAf.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_8oKXAAf.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_GupD5Qb.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_GupD5Qb.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 }, @@ -319,14 +319,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -354,8 +354,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -400,8 +400,8 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_EFiJD6C.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_EFiJD6C.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index 80253b4f0..05942c784 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 11, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index 20379bb58..88c1a8074 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -67,14 +67,14 @@ "id": 3, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_A3AWK0e.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_A3AWK0e.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_JdNZ8pq.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_JdNZ8pq.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", "width": 100, "height": 40 }, @@ -94,8 +94,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_m1Symmo.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_m1Symmo.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 }, @@ -127,14 +127,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -159,8 +159,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index 891ca7001..2e03fb44d 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -87,14 +87,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_CJj7ytu.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_CJj7ytu.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_nJ9965Y.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_nJ9965Y.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -103,14 +103,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60_3tl8s6s.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60_3tl8s6s.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60_WHn2XPR.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60_WHn2XPR.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index f910b95d7..1f3adbda7 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -67,8 +67,8 @@ "id": 5, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_KS9Uh0l.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_KS9Uh0l.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 40 }, @@ -88,8 +88,8 @@ "id": 5, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_kcxnkE8.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_kcxnkE8.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, @@ -126,14 +126,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_iKXvc5j.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_moF3lTy.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -158,8 +158,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index 0d3dac6b6..acfaeca99 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -74,14 +74,14 @@ "id": 15, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_jQ9quCl.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_jQ9quCl.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_mfg9Hat.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60_mfg9Hat.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", "width": 100, "height": 40 }, @@ -101,8 +101,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_bj9aWVy.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_bj9aWVy.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 }, @@ -138,8 +138,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -167,8 +167,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -233,14 +233,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_Z7O3taC.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_Z7O3taC.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_d2IUyJ1.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_d2IUyJ1.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -249,8 +249,8 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60_gYjgh70.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60_gYjgh70.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index 6f1e52f97..3179fe843 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -88,8 +88,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -171,8 +171,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index faefa0dfb..3ccdd8cc9 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 8, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index 389c26a70..1245a5228 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -34,8 +34,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } @@ -44,8 +44,8 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, @@ -88,14 +88,14 @@ "id": 7, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_qMB1itL.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_qMB1itL.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_ls5YpjY.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_ls5YpjY.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 }, @@ -132,8 +132,8 @@ "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index b5dfda318..dca646b6e 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -377,7 +377,7 @@ def compare_json(self, path: str, json_file: str): replace_end = "/media/images/image." expected_data = re.sub(regex_start, replace_end, expected_data) api_data = re.sub(regex_start, replace_end, api_data) - regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9])+[a-zA-Z0-9_]*\.(jpg|webp)" + regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9]+)[a-zA-Z0-9_]*\.(jpg|webp)" regex_replace_end = r"\.format-\g<1>\.\g<2>-\g<3>\.\g<4>" expected_data = re.sub(regex_end, regex_replace_end, expected_data) api_data = re.sub(regex_end, regex_replace_end, api_data) From 39edc118e28b5a421136c614153756ea274dfc96 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 13:59:45 +0000 Subject: [PATCH 13/20] Fix random image rendition IDs in tests --- etna/api/tests/expected_results/article.json | 60 +++++++++---------- .../tests/expected_results/article_index.json | 12 ++-- etna/api/tests/expected_results/arts.json | 44 +++++++------- etna/api/tests/expected_results/author.json | 12 ++-- .../tests/expected_results/early_modern.json | 48 +++++++-------- .../expected_results/focused_article.json | 48 +++++++-------- .../expected_results/highlight_gallery.json | 36 +++++------ etna/api/tests/expected_results/people.json | 12 ++-- etna/api/tests/expected_results/postwar.json | 32 +++++----- etna/api/tests/test_pages.py | 2 +- 10 files changed, 153 insertions(+), 153 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index 090485dbb..2322bb068 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -28,14 +28,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -95,14 +95,14 @@ "id": 13, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -189,14 +189,14 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -319,14 +319,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -348,14 +348,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -375,14 +375,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -400,14 +400,14 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index 05942c784..ee5f74f5c 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -28,14 +28,14 @@ "id": 11, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index 88c1a8074..5437f1799 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -28,14 +28,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -88,14 +88,14 @@ "id": 3, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -127,14 +127,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -153,14 +153,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -181,14 +181,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index 2e03fb44d..b93c14c7b 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -28,14 +28,14 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index 1f3adbda7..7ece3811d 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -28,14 +28,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -73,8 +73,8 @@ "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", "width": 100, "height": 40 }, @@ -88,14 +88,14 @@ "id": 5, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -126,14 +126,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -152,14 +152,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -180,14 +180,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index acfaeca99..304cd0d99 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -28,14 +28,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -95,14 +95,14 @@ "id": 15, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -132,14 +132,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -161,14 +161,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -188,14 +188,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -255,8 +255,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index 3179fe843..5cb2a7453 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -28,14 +28,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -82,14 +82,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -165,14 +165,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -192,14 +192,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index 3ccdd8cc9..15e5b8e87 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -28,14 +28,14 @@ "id": 8, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index 1245a5228..3e76586ee 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -28,14 +28,14 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } @@ -50,8 +50,8 @@ "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", "width": 100, "height": 100 } @@ -73,8 +73,8 @@ "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.jpg", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", "width": 100, "height": 40 }, @@ -88,14 +88,14 @@ "id": 7, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 }, @@ -126,14 +126,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 68 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 68 } diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index dca646b6e..f546d4cb6 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -378,7 +378,7 @@ def compare_json(self, path: str, json_file: str): expected_data = re.sub(regex_start, replace_end, expected_data) api_data = re.sub(regex_start, replace_end, api_data) regex_end = r"\.format-(jpeg|webp)\.(jpegquality|webpquality)-([0-9]+)[a-zA-Z0-9_]*\.(jpg|webp)" - regex_replace_end = r"\.format-\g<1>\.\g<2>-\g<3>\.\g<4>" + regex_replace_end = r".format-\g<1>.\g<2>-\g<3>.\g<4>" expected_data = re.sub(regex_end, regex_replace_end, expected_data) api_data = re.sub(regex_end, regex_replace_end, api_data) From ecc3f8292df71ad725e9209079f9ac1bd6bbbc0c Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 14:05:51 +0000 Subject: [PATCH 14/20] Fix random image rendition IDs in tests --- etna/api/tests/test_pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/api/tests/test_pages.py b/etna/api/tests/test_pages.py index f546d4cb6..4e6fcc738 100644 --- a/etna/api/tests/test_pages.py +++ b/etna/api/tests/test_pages.py @@ -373,7 +373,7 @@ def compare_json(self, path: str, json_file: str): expected_data = self.replace_placeholders(expected_data) # Remove random image rendition IDs - regex_start = r"/media/images/[a-zA-Z0-9_]+\.[a-fA-F0-9]{6,8}\." + regex_start = r"/media/images/[a-zA-Z0-9_]+\.([a-fA-F0-9]{6,8}\.)?" replace_end = "/media/images/image." expected_data = re.sub(regex_start, replace_end, expected_data) api_data = re.sub(regex_start, replace_end, api_data) From a6f978b8622cf9f39a5d162b4dd124dfff7c0931 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 14:07:30 +0000 Subject: [PATCH 15/20] Fix random image rendition IDs in tests --- etna/api/tests/expected_results/article.json | 16 +++++----- .../tests/expected_results/article_index.json | 8 ++--- etna/api/tests/expected_results/arts.json | 16 +++++----- etna/api/tests/expected_results/author.json | 24 +++++++------- .../tests/expected_results/early_modern.json | 16 +++++----- .../expected_results/focused_article.json | 32 +++++++++---------- .../expected_results/highlight_gallery.json | 8 ++--- etna/api/tests/expected_results/people.json | 8 ++--- etna/api/tests/expected_results/postwar.json | 16 +++++----- 9 files changed, 72 insertions(+), 72 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index 2322bb068..42ea93448 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -44,14 +44,14 @@ "id": 12, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -74,14 +74,14 @@ "id": 13, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 40 }, diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index ee5f74f5c..bd2c2b6f9 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -44,14 +44,14 @@ "id": 11, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index 5437f1799..f1ebb84a6 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -44,14 +44,14 @@ "id": 2, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -67,14 +67,14 @@ "id": 3, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 40 }, diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index b93c14c7b..baa249204 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -44,14 +44,14 @@ "id": 10, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -87,14 +87,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -103,14 +103,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index 7ece3811d..93ee10863 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -44,14 +44,14 @@ "id": 4, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -67,14 +67,14 @@ "id": 5, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 40 }, diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index 304cd0d99..d70ab0bfd 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -44,14 +44,14 @@ "id": 14, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -74,14 +74,14 @@ "id": 15, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 40 }, @@ -233,14 +233,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -249,14 +249,14 @@ "id": 9, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-128x128.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-128x128.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index 5cb2a7453..d85e98532 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -44,14 +44,14 @@ "id": 16, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index 15e5b8e87..5d32caab2 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -44,14 +44,14 @@ "id": 8, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index 3e76586ee..ef979eacc 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -44,14 +44,14 @@ "id": 6, "title": "An image", "jpeg": { - "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.webp", + "url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 100 } @@ -67,14 +67,14 @@ "id": 7, "title": "An image", "jpeg": { - "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.jpg", + "url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60.bgcolor-fff.jpg", "width": 100, "height": 40 }, "webp": { - "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.webp", + "url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-60.bgcolor-fff.webp", "width": 100, "height": 40 }, From 3abe5701e998fc1d0e80eeb3ae98e72c5c6b3723 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 14:15:37 +0000 Subject: [PATCH 16/20] Fix tests --- etna/api/tests/expected_results/article.json | 4 ++-- etna/api/tests/expected_results/arts.json | 4 ++-- etna/api/tests/expected_results/early_modern.json | 4 ++-- etna/api/tests/expected_results/focused_article.json | 4 ++-- etna/api/tests/expected_results/highlight_gallery.json | 4 ++-- etna/api/tests/expected_results/postwar.json | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index 42ea93448..abd155019 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -89,7 +89,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "hero_image_small": { "id": 13, @@ -110,7 +110,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "display_content_warning": false, "custom_warning_text": "", diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index f1ebb84a6..0cbb06fc9 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -82,7 +82,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "hero_image_small": { "id": 3, @@ -103,7 +103,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "global_alert": null, "type_label": "Explore the collection", diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index 93ee10863..79dcd9fc4 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -82,7 +82,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "hero_image_small": { "id": 5, @@ -103,7 +103,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "global_alert": null, "type_label": "Explore the collection", diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index d70ab0bfd..8133b7769 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -89,7 +89,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "hero_image_small": { "id": 15, @@ -110,7 +110,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "display_content_warning": false, "custom_warning_text": "", diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index d85e98532..c5b9e38fd 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -104,13 +104,13 @@ "title": "An image", "jpeg": { "url": "/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.bgcolor-fff.jpg", - "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, "webp": { "url": "/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.bgcolor-fff.webp", - "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.bgcolor-fff.webp", + "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.webp", "width": 100, "height": 100 }, diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index ef979eacc..12de075d8 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -82,7 +82,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "hero_image_small": { "id": 7, @@ -103,7 +103,7 @@ "translation": null, "copyright": null, "is_sensitive": false, - "custom_sensitive_image": null + "custom_sensitive_image_warning": null }, "global_alert": null, "type_label": "Explore the collection", From 89757e1c75d81ab3c918dc5c5aee7b58f3d025aa Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 12 Dec 2024 14:20:13 +0000 Subject: [PATCH 17/20] Fix tests --- etna/api/tests/expected_results/highlight_gallery.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index c5b9e38fd..4d26ea61d 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -103,13 +103,13 @@ "id": 1, "title": "An image", "jpeg": { - "url": "/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.bgcolor-fff.jpg", + "url": "/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.jpg", "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-jpeg.jpegquality-60.jpg", "width": 100, "height": 100 }, "webp": { - "url": "/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.bgcolor-fff.webp", + "url": "/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.webp", "full_url": "https://nationalarchives.gov.uk/media/images/example_E1PUN8.max-1024x1024.format-webp.webpquality-60.webp", "width": 100, "height": 100 From 967fe132db1d5b3820bf6dc0f92141a791769be0 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 16 Dec 2024 11:06:17 +0000 Subject: [PATCH 18/20] Update etna/core/serializers/images.py Co-authored-by: James Biggs <62654785+jamesbiggs@users.noreply.github.com> --- etna/core/serializers/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/core/serializers/images.py b/etna/core/serializers/images.py index 29d467a65..50cc0666c 100644 --- a/etna/core/serializers/images.py +++ b/etna/core/serializers/images.py @@ -43,7 +43,7 @@ def __init__( def to_representation(self, value): if value: - background_colour_redition = ( + background_colour_rendition = ( f"|bgcolor-{self.background_colour}" if self.background_colour else "" ) jpeg_image = value.get_rendition( From 82b747de49a31b2d4df3a612f5c0742214f8abd5 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 16 Dec 2024 11:06:22 +0000 Subject: [PATCH 19/20] Update etna/core/serializers/images.py Co-authored-by: James Biggs <62654785+jamesbiggs@users.noreply.github.com> --- etna/core/serializers/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/core/serializers/images.py b/etna/core/serializers/images.py index 50cc0666c..0159ebdaa 100644 --- a/etna/core/serializers/images.py +++ b/etna/core/serializers/images.py @@ -50,7 +50,7 @@ def to_representation(self, value): f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}{background_colour_redition}" ) webp_image = value.get_rendition( - f"{self.rendition_size}|format-webp|webpquality-{self.webp_quality}{background_colour_redition}" + f"{self.rendition_size}|format-webp|webpquality-{self.webp_quality}{background_colour_rendition}" ) additional_images = {} From ad17437c090a6af4193ba6deef91861f34ccdc4a Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 16 Dec 2024 11:06:26 +0000 Subject: [PATCH 20/20] Update etna/core/serializers/images.py Co-authored-by: James Biggs <62654785+jamesbiggs@users.noreply.github.com> --- etna/core/serializers/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etna/core/serializers/images.py b/etna/core/serializers/images.py index 0159ebdaa..ca70b7957 100644 --- a/etna/core/serializers/images.py +++ b/etna/core/serializers/images.py @@ -47,7 +47,7 @@ def to_representation(self, value): f"|bgcolor-{self.background_colour}" if self.background_colour else "" ) jpeg_image = value.get_rendition( - f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}{background_colour_redition}" + f"{self.rendition_size}|format-jpeg|jpegquality-{self.jpeg_quality}{background_colour_rendition}" ) webp_image = value.get_rendition( f"{self.rendition_size}|format-webp|webpquality-{self.webp_quality}{background_colour_rendition}"