def test_update_document_response_format(self):
        """Test that the response format is as expected."""
        self._set_up_for_text_field_test()
        test_cases = [
            ([{"_id": "1", "text_field": "updated text field"}], False, 200, "1"),  # A valid doc
            ([{"text_field": "updated text field"}], True, 400, ""),  # An invalid doc without _id
            ([{"text_field": ["1", "1"], "_id": "1"}], True, 400, "1"),  # An invalid doc with wrong field type
            ([{"text_field": "updated text field", "_id": "2"}], True, 404, "2")  # An invalid doc with non-existent _id
        ]
        for update_docs, expected_error, expected_status, expected_id in test_cases:
            with self.subTest(f"{update_docs} - {expected_error} - {expected_status} - {expected_id}"):
                r = self.config.document.partial_update_documents_by_index_name(
                    partial_documents=update_docs,
                    index_name=self.structured_index_name).dict(exclude_none=True, by_alias=True)

                if expected_status >= 400:
                    self.assertIn("error", r["items"][0])
                self.assertEqual(expected_error, r["errors"])
                self.assertEqual(expected_status, r["items"][0]["status"])
                self.assertEqual(expected_id, r["items"][0]["_id"])
                self.assertIn("index_name", r)
                self.assertIn("processingTimeMs", r)
Test that the response format is as expected.
tests/integ_tests/core/document/test_partial_document_update.py