@@ -2059,17 +2059,17 @@ class TestMultipleChoiceField(FieldValues):
2059
2059
"""
2060
2060
valid_inputs = {
2061
2061
(): list (),
2062
- (" aircon" ,): [" aircon" ],
2063
- (" aircon" , " manual" ): [" aircon" , " manual" ],
2064
- (" manual" , " aircon" ): [" manual" , " aircon" ],
2062
+ (' aircon' ,): [' aircon' ],
2063
+ (' aircon' , ' manual' ): [' aircon' , ' manual' ],
2064
+ (' manual' , ' aircon' ): [' manual' , ' aircon' ],
2065
2065
}
2066
2066
invalid_inputs = {
2067
2067
'abc' : ['Expected a list of items but got type "str".' ],
2068
2068
('aircon' , 'incorrect' ): ['"incorrect" is not a valid choice.' ]
2069
2069
}
2070
2070
outputs = [
2071
- ([" aircon" , " manual" , " incorrect" ], [" aircon" , " manual" , " incorrect" ]),
2072
- ([" manual" , " aircon" , " incorrect" ], [" manual" , " aircon" , " incorrect" ]),
2071
+ ([' aircon' , ' manual' , ' incorrect' ], [' aircon' , ' manual' , ' incorrect' ]),
2072
+ ([' manual' , ' aircon' , ' incorrect' ], [' manual' , ' aircon' , ' incorrect' ]),
2073
2073
]
2074
2074
field = serializers .MultipleChoiceField (
2075
2075
choices = [
@@ -2084,7 +2084,7 @@ def test_against_partial_and_full_updates(self):
2084
2084
field .partial = False
2085
2085
assert field .get_value (QueryDict ('' )) == []
2086
2086
field .partial = True
2087
- assert field .get_value (QueryDict ("" )) == rest_framework .fields .empty
2087
+ assert field .get_value (QueryDict ('' )) == rest_framework .fields .empty
2088
2088
2089
2089
def test_valid_inputs_is_json_serializable (self ):
2090
2090
for input_value , _ in get_items (self .valid_inputs ):
@@ -2095,7 +2095,7 @@ def test_valid_inputs_is_json_serializable(self):
2095
2095
except TypeError as e :
2096
2096
assert (
2097
2097
False
2098
- ), f" Validated output not JSON serializable: { repr (validated )} ; Error: { e } "
2098
+ ), f' Validated output not JSON serializable: { repr (validated )} ; Error: { e } '
2099
2099
2100
2100
def test_output_is_json_serializable (self ):
2101
2101
for output_value , _ in get_items (self .outputs ):
@@ -2105,8 +2105,8 @@ def test_output_is_json_serializable(self):
2105
2105
json .dumps (representation )
2106
2106
except TypeError as e :
2107
2107
assert False , (
2108
- f" to_representation output not JSON serializable: "
2109
- f" { repr (representation )} ; Error: { e } "
2108
+ f' to_representation output not JSON serializable: '
2109
+ f' { repr (representation )} ; Error: { e } '
2110
2110
)
2111
2111
2112
2112
0 commit comments