2323from testit_python_commons .models .test_result import TestResult
2424from testit_python_commons .services .logger import adapter_logger
2525from testit_python_commons .services .retry import retry
26- from testit_python_commons .utils .html_escape_utils import HtmlEscapeUtils
27- from typing import List , Any
26+ from typing import List
2827
2928
3029class ApiClientWorker :
@@ -61,11 +60,6 @@ def __get_api_client(api_client_config: Configuration, token: str) -> ApiClient:
6160 header_name = 'Authorization' ,
6261 header_value = 'PrivateToken ' + token )
6362
64- @staticmethod
65- def _escape_html_in_model (model : Any ) -> Any :
66- """Apply HTML escaping to all models before sending to API"""
67- return HtmlEscapeUtils .escape_html_in_object (model )
68-
6963 @adapter_logger
7064 def create_test_run (self , test_run_name : str = None ) -> str :
7165 test_run_name = f'TestRun_{ datetime .today ().strftime ("%Y-%m-%dT%H:%M:%S" )} ' if \
@@ -74,7 +68,6 @@ def create_test_run(self, test_run_name: str = None) -> str:
7468 self .__config .get_project_id (),
7569 test_run_name
7670 )
77- model = self ._escape_html_in_model (model )
7871
7972 response = self .__test_run_api .create_empty (create_empty_request = model )
8073
@@ -95,7 +88,6 @@ def get_test_run(self, test_run_id: str) -> TestRunV2ApiResult:
9588 def update_test_run (self , test_run : TestRunV2ApiResult ) -> None :
9689 """Function updates test run."""
9790 model = Converter .build_update_empty_request (test_run )
98- model = HtmlEscapeUtils .escape_html_in_object (model )
9991 logging .debug (f"Updating test run with model: { model } " )
10092
10193 self .__test_run_api .update_empty (update_empty_request = model )
@@ -321,7 +313,6 @@ def __create_test(self, test_result: TestResult) -> str:
321313 test_result ,
322314 self .__config .get_project_id (),
323315 work_item_ids_for_link_with_auto_test )
324- model = self ._escape_html_in_model (model )
325316
326317 autotest_response = self .__autotest_api .create_auto_test (create_auto_test_request = model )
327318
@@ -333,7 +324,6 @@ def __create_test(self, test_result: TestResult) -> str:
333324 def __create_tests (self , autotests_for_create : List [AutoTestPostModel ]) -> None :
334325 logging .debug (f'Creating autotests: "{ autotests_for_create } ' )
335326
336- autotests_for_create = self ._escape_html_in_model (autotests_for_create )
337327 self .__autotest_api .create_multiple (auto_test_post_model = autotests_for_create )
338328
339329 logging .debug (f'Autotests were created' )
@@ -343,7 +333,6 @@ def __update_test(self, test_result: TestResult, autotest: AutoTestApiResult) ->
343333 logging .debug (f'Autotest "{ test_result .get_autotest_name ()} " was found' )
344334
345335 model = Converter .prepare_to_update_autotest (test_result , autotest , self .__config .get_project_id ())
346- model = self ._escape_html_in_model (model )
347336
348337 try :
349338 self .__autotest_api .update_auto_test (update_auto_test_request = model )
@@ -356,7 +345,6 @@ def __update_test(self, test_result: TestResult, autotest: AutoTestApiResult) ->
356345 def __update_tests (self , autotests_for_update : List [AutoTestPutModel ]) -> None :
357346 logging .debug (f'Updating autotests: { autotests_for_update } ' )
358347
359- autotests_for_update = self ._escape_html_in_model (autotests_for_update )
360348 self .__autotest_api .update_multiple (auto_test_put_model = autotests_for_update )
361349
362350 logging .debug (f'Autotests were updated' )
@@ -384,7 +372,6 @@ def __load_test_result(self, test_result: TestResult) -> str:
384372 model = Converter .test_result_to_testrun_result_post_model (
385373 test_result ,
386374 self .__config .get_configuration_id ())
387- model = self ._escape_html_in_model (model )
388375
389376 response = self .__test_run_api .set_auto_test_results_for_test_run (
390377 id = self .__config .get_test_run_id (),
@@ -412,8 +399,6 @@ def update_test_results(self, fixtures_containers: dict, test_result_ids: dict)
412399 test_result .get_setup_results ())
413400 model .teardown_results = Converter .step_results_to_auto_test_step_result_update_request (
414401 test_result .get_teardown_results ())
415-
416- model = self ._escape_html_in_model (model )
417402
418403 try :
419404 self .__test_results_api .api_v2_test_results_id_put (
0 commit comments