Repository: WordPress/openverse-api

Issue:
Examples test is failing due to dead link mask
## Description
<!-- Concisely describe the bug. Compare your experience with what you expected to happen. -->
<!-- For example: "I clicked the 'submit' button and instead of seeing a thank you message, I saw a blank page." -->
Presently our `examples_test.py` test module is failing due to the expected result being filtered by a dead link mask. This also appears to be a region-specific issue, as the URL in question (https://live.staticflickr.com/65535/51745389858_c10358e1a3_b.jpg) can only be viewed in certain regions (Turkey & Germany are the only successful ones so far). Other regions are provided with this URL when viewing the foreign landing page: https://live.staticflickr.com/65535/51745389858_f1746c924c_h.jpg. 

We could try and alter these tests to disable the dead link mask or change the example. Given how these tests are run, the former may be a little bit hack-y. The latter is certainly preferred, but involves changing a number of results & tests.

## Reproduction
<!-- Provide detailed steps to reproduce the bug. -->
1. Run tests from the US or VPN into the US
2. Run `just api-test`
3. Observe failure with the `test_image_success_examples` test

## Additional context
<!-- Add any other context about the problem here; or delete the section entirely. -->

## Resolution
<!-- Replace the [ ] with [x] to check the box. -->
- [ ] 🙋 I would be interested in resolving this bug.



Discussion:

Resolving patch:
diff --git a/api/catalog/api/examples/image_requests.py b/api/catalog/api/examples/image_requests.py
--- a/api/catalog/api/examples/image_requests.py
+++ b/api/catalog/api/examples/image_requests.py
@@ -5,7 +5,7 @@
 origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")
 
 auth = f'-H "Authorization: Bearer {token}"' if token else ""
-identifier = "cdbd3bf6-1745-45bb-b399-61ee149cd58a"
+identifier = "4bc43a04-ef46-4544-a0c1-63c63f56e276"
 
 syntax_examples = {
     "using single query parameter": "test",
@@ -31,10 +31,10 @@
 )
 
 image_search_curl = f"""
-# Search for images titled "Bust" by Talbot
+# Search for images titled "Bark" by Sullivan
 curl \\
   {auth} \\
-  "{origin}/v1/images/?title=Train&creator=Trolle"
+  "{origin}/v1/images/?title=Bark&creator=Sullivan"
 """
 
 image_stats_curl = f"""
diff --git a/api/catalog/api/examples/image_responses.py b/api/catalog/api/examples/image_responses.py
--- a/api/catalog/api/examples/image_responses.py
+++ b/api/catalog/api/examples/image_responses.py
@@ -3,48 +3,65 @@
 
 origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")
 
-identifier = "cdbd3bf6-1745-45bb-b399-61ee149cd58a"
+identifier = "4bc43a04-ef46-4544-a0c1-63c63f56e276"
 
 base_image = {
     "id": identifier,
-    "title": "Train area in Copenhagen South / Tog område i Syd København",
-    "foreign_landing_url": "https://www.flickr.com/photos/126744325@N07/51745389858",
-    "url": "https://live.staticflickr.com/65535/51745389858_c10358e1a3_b.jpg",
-    "creator": "Kristoffer Trolle",
-    "creator_url": "https://www.flickr.com/photos/126744325@N07",
-    "license": "by",
-    "license_version": "2.0",
-    "license_url": "https://creativecommons.org/licenses/by/2.0/",
-    "provider": "flickr",
-    "source": "flickr",
+    "title": "Tree Bark Photo",
+    "foreign_landing_url": "https://stocksnap.io/photo/XNVBVXO3B7",
+    "url": "https://cdn.stocksnap.io/img-thumbs/960w/XNVBVXO3B7.jpg",
+    "creator": "Tim Sullivan",
+    "creator_url": "https://www.secretagencygroup.com",
+    "license": "cc0",
+    "license_version": "1.0",
+    "license_url": "https://creativecommons.org/publicdomain/zero/1.0/",
+    "provider": "stocksnap",
+    "source": "stocksnap",
     "category": "photograph",
-    "filesize": 157497,
-    "filetype": "jpg",
+    "filesize": None,
+    "filetype": None,
     "tags": [
-        {"name": "copenhagen"},
-        {"name": "danmark"},
-        {"name": "denmark"},
-        {"name": "dsb"},
-        {"name": "fujifilmxf35mmf2rwr"},
-        {"name": "fujifilmxh1"},
-        {"name": "københavn"},
-        {"name": "område"},
-        {"name": "south"},
-        {"name": "syd"},
-        {"name": "tiffenblackpromist14filter"},
-        {"name": "tog"},
-        {"name": "train"},
+        {"name": "tree"},
+        {"name": "bark"},
+        {"name": "texture"},
+        {"name": "wood"},
+        {"name": "nature"},
+        {"name": "pattern"},
+        {"name": "rough"},
+        {"name": "surface"},
+        {"name": "brown"},
+        {"name": "old"},
+        {"name": "background"},
+        {"name": "trunk"},
+        {"name": "natural"},
+        {"name": "forest"},
+        {"name": "detail"},
+        {"name": "lumber"},
+        {"name": "weathered"},
+        {"name": "timber"},
+        {"name": "stump"},
+        {"name": "closeup"},
+        {"name": "root"},
     ],
-    "attribution": '"Train area in Copenhagen South / Tog område i Syd København" by Kristoffer Trolle is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.',  # noqa: E501
+    "attribution": None,
     "fields_matched": [],
-    "mature": None,
-    "height": 683,
-    "width": 1024,
+    "mature": False,
+    "height": None,
+    "width": None,
     "thumbnail": f"{origin}/v1/images/{identifier}/thumb/",
     "detail_url": f"{origin}/v1/images/{identifier}/",
     "related_url": f"{origin}/v1/images/{identifier}/related/",
 }
 
+detailed_image = base_image | {
+    "attribution": '"Tree Bark Photo" by Tim Sullivan is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.',  # noqa: E501
+    "height": 4016,
+    "filesize": 896128,
+    "filetype": "jpg",
+    "width": 6016,
+    "mature": None,
+}
+
 image_search_200_example = {
     "application/json": {
         "result_count": 1,
@@ -93,7 +110,7 @@
     ]
 }
 
-image_detail_200_example = {"application/json": base_image}
+image_detail_200_example = {"application/json": detailed_image}
 
 image_detail_404_example = {"application/json": {"detail": "Not found."}}
 
@@ -131,12 +148,12 @@
     "application/json": {
         "version": "1.0",
         "type": "photo",
-        "width": 1024,
-        "height": 683,
-        "title": "Train area in Copenhagen South / Tog område i Syd København",
-        "author_name": "Kristoffer Trolle",
-        "author_url": "https://www.flickr.com/photos/126744325@N07",
-        "license_url": "https://creativecommons.org/licenses/by/2.0/",
+        "width": 6016,
+        "height": 4016,
+        "title": "Tree Bark Photo",
+        "author_name": "Tim Sullivan",
+        "author_url": "https://www.secretagencygroup.com",
+        "license_url": "https://creativecommons.org/publicdomain/zero/1.0/",
     }
 }
 


Test patch: