def test_illegal_field_name_unstructured(self):
        """Test illegal chars in field names for unstructured index"""
        index_name = self.standard_unstructured_index_name

        illegal_field_names = self.illegal_field_name + self.illegal_for_unstructured_index
        for illegal_field_name in illegal_field_names:
            with self.subTest(f"Illegal field name: {repr(illegal_field_name)}"):
                docs = [{f"{illegal_field_name}": "hello"}]

                # Ensure these special chars can be used in field names
                tensor_fields = [f"{illegal_field_name}"]
                res = self.client.index(index_name).add_documents(docs, tensor_fields=tensor_fields)

                self.assertEqual(res["errors"], True)
                for item in res["items"]:
                    self.assertEqual(400, item["status"])
                    self.assertIn("Field name", item["error"])
Test illegal chars in field names for unstructured index
tests/api_tests/v1/tests/api_tests/test_special_chars_in_fieldnames_and_filters.py