def test_add_documents_nonImageContentForAnImageField(self):
        """Test to ensure a proper error is raised when non-image content is added to an image field"""
        documents = [
            {
                "_id": "1",
                "image_field": "this is not an image/url/path",
                "title": "A image field with non-image content"
            },
            {
                "_id": "2",
                "image_field": "this is not an image/url/path/again",
                "image_field_2": "this is not an image/url/path/again",
                "title": "A document with 2 invalid image fields"
            },
            {
                "_id": "3",
                "image_field": "this is not an image/url/path/again-3",
                "image_field_2": "this is not an image/url/path/again-3",
                "title": "Another document with 2 invalid image fields"
            },

        ]

        r = self.add_documents(
            config=self.config, add_docs_params=AddDocsParams(
                index_name=self.index_name_img_no_chunking, docs=documents
            )
        )

        self.assertEqual(True, r.errors)
        self.assertEqual(3, r._batch_response_stats.failure_count)
        self.assertEqual(3, len(r.items))
        for item in r.items:
            self.assertEqual(400, item.status)
            # modality mismatch
            self.assertIn("is not a local file or a valid url", item.message)
Test to ensure a proper error is raised when non-image content is added to an image field
tests/integ_tests/tensor_search/integ_tests/test_add_documents_structured.py