From 1977c5b5753e10d4c9ef047c3e809c57ba10a9af Mon Sep 17 00:00:00 2001 From: fbz Date: Sun, 6 Jul 2025 00:30:21 +0800 Subject: [PATCH] minor: rest old formatting --- tests/test_fields.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_fields.py b/tests/test_fields.py index 2040a59d0..cb4560100 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -2059,17 +2059,17 @@ class TestMultipleChoiceField(FieldValues): """ valid_inputs = { (): list(), - ("aircon",): ["aircon"], - ("aircon", "manual"): ["aircon", "manual"], - ("manual", "aircon"): ["manual", "aircon"], + ('aircon',): ['aircon'], + ('aircon', 'manual'): ['aircon', 'manual'], + ('manual', 'aircon'): ['manual', 'aircon'], } invalid_inputs = { 'abc': ['Expected a list of items but got type "str".'], ('aircon', 'incorrect'): ['"incorrect" is not a valid choice.'] } outputs = [ - (["aircon", "manual", "incorrect"], ["aircon", "manual", "incorrect"]), - (["manual", "aircon", "incorrect"], ["manual", "aircon", "incorrect"]), + (['aircon', 'manual', 'incorrect'], ['aircon', 'manual', 'incorrect']), + (['manual', 'aircon', 'incorrect'], ['manual', 'aircon', 'incorrect']), ] field = serializers.MultipleChoiceField( choices=[ @@ -2084,7 +2084,7 @@ class TestMultipleChoiceField(FieldValues): field.partial = False assert field.get_value(QueryDict('')) == [] field.partial = True - assert field.get_value(QueryDict("")) == rest_framework.fields.empty + assert field.get_value(QueryDict('')) == rest_framework.fields.empty def test_valid_inputs_is_json_serializable(self): for input_value, _ in get_items(self.valid_inputs): @@ -2095,7 +2095,7 @@ class TestMultipleChoiceField(FieldValues): except TypeError as e: assert ( False - ), f"Validated output not JSON serializable: {repr(validated)}; Error: {e}" + ), f'Validated output not JSON serializable: {repr(validated)}; Error: {e}' def test_output_is_json_serializable(self): for output_value, _ in get_items(self.outputs): @@ -2105,8 +2105,8 @@ class TestMultipleChoiceField(FieldValues): json.dumps(representation) except TypeError as e: assert False, ( - f"to_representation output not JSON serializable: " - f"{repr(representation)}; Error: {e}" + f'to_representation output not JSON serializable: ' + f'{repr(representation)}; Error: {e}' )