From 3441e14197724b4f2ee8c08cbe0246c98498be50 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 5 Feb 2026 09:08:03 +0100 Subject: [PATCH] Check call args for empty string with Form --- .../test_form/test_nullable_and_defaults.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/test_request_params/test_form/test_nullable_and_defaults.py b/tests/test_request_params/test_form/test_nullable_and_defaults.py index 644b058824..2679da309a 100644 --- a/tests/test_request_params/test_form/test_nullable_and_defaults.py +++ b/tests/test_request_params/test_form/test_nullable_and_defaults.py @@ -175,8 +175,11 @@ def test_nullable_required_pass_empty_str(path: str): ) assert mock_convert.call_count == 3, "Validator should be called for each field" - # TODO: Check call args ? - + assert mock_convert.call_args_list == [ + (""), # int_val + (""), # str_val + (["0"]), # list_val + ] assert response.status_code == 200, response.text assert response.json() == { "int_val": None, @@ -360,8 +363,11 @@ def test_nullable_non_required_pass_empty_str(path: str): ) assert mock_convert.call_count == 3, "Validator should be called for each field" - # TODO: Check call args ? - + assert mock_convert.call_args_list == [ + (""), # int_val + (""), # str_val + (["0"]), # list_val + ] assert response.status_code == 200, response.text assert response.json() == { "int_val": None, @@ -554,8 +560,11 @@ def test_nullable_with_non_null_default_pass_empty_str(path: str): ) assert mock_convert.call_count == 3, "Validator should be called for each field" - # TODO: Check call args ? - + assert mock_convert.call_args_list == [ + (""), # int_val + (""), # str_val + (["0"]), # list_val + ] assert response.status_code == 200, response.text assert response.json() == { "int_val": None,