def test_proper_error_when_adding_documents_with_private_image_without_access(self):
        """A test to check that the proper error is raised when adding documents with private images without access."""
        documents = [
            {
                "image_field_1": "https://d2k91vq0avo7lq.cloudfront.net/ai_hippo_realistic_small.png",
                "text_field_1": "A private image with a png extension",
                "_id": "1"
            },
            {
                "image_field_1": "https://d2k91vq0avo7lq.cloudfront.net/ai_hippo_realistic_small",
                "text_field_1": "A private image without an extension",
                "_id": "2"
            }
        ]
        for index_name in [self.unstructured_image_index_name, self.structured_image_index_name]:
            tensor_fields = ["image_field_1"] if (
                    index_name == self.unstructured_image_index_name
            ) else None
            with self.subTest(f"{index_name}"):
                res = self.client.index(index_name).add_documents(
                    documents, tensor_fields=tensor_fields,
                )
                self.assertEqual(True, res["errors"], res)
                for item in res["items"]:
                    self.assertEqual(400, item["status"], item)
                    self.assertIn("403", item["error"], item)
A test to check that the proper error is raised when adding documents with private images without access.
tests/api_tests/v1/tests/api_tests/test_add_documents_common.py