@@ -779,8 +779,7 @@ def test(self):
779779
780780class TestListSerializerDictErrorBehavior :
781781 """
782- Tests for the proposed dict-based error structure for ListSerializer,
783- and consistency with ListField.
782+ Tests dict-based error structure for ListSerializer, and consistency with ListField.
784783
785784 https://github.com/encode/django-rest-framework/issues/7279
786785 """
@@ -805,8 +804,8 @@ def test_listserializer_dict_error_format(self):
805804
806805 data = [
807806 {"num" : "1" },
808- {"num" : "x" },
809- {"num" : "0" },
807+ {"num" : "x" },
808+ {"num" : "0" },
810809 {"num" : "hello" },
811810 ]
812811
@@ -820,22 +819,20 @@ def test_listserializer_dict_error_format(self):
820819 "num" : [ErrorDetail (string = "Must be a valid boolean." , code = "invalid" )]
821820 }
822821
823-
824-
825822 def test_listserializer_and_listfield_consistency (self ):
826823
827824 data = {
828825 "list_serializer" : [
829826 {"num" : "1" },
830- {"num" : "wrong" },
827+ {"num" : "wrong" },
831828 {"num" : "0" },
832- {"num" : "" },
829+ {"num" : "" },
833830 ],
834831 "list_field" : [
835832 {"ok" : "x" },
836833 {},
837834 {"valid" : "y" },
838- {},
835+ {},
839836 ],
840837 }
841838
@@ -847,12 +844,12 @@ def test_listserializer_and_listfield_consistency(self):
847844 assert isinstance (errors ["list_serializer" ], dict )
848845 assert isinstance (errors ["list_field" ], dict )
849846
850- assert set (errors ["list_serializer" ].keys ()) == {1 ,3 }
847+ assert set (errors ["list_serializer" ].keys ()) == {1 , 3 }
851848 assert set (errors ["list_field" ].keys ()) == {1 , 3 }
852849
853850 assert errors ["list_serializer" ][1 ] == {
854851 "num" : [ErrorDetail (string = "Must be a valid boolean." , code = "invalid" )]
855852 }
856853
857854 for index , value in errors ["list_field" ].items ():
858- assert value == [ErrorDetail (string = 'This dictionary may not be empty.' , code = 'empty' )]
855+ assert value == [ErrorDetail (string = 'This dictionary may not be empty.' , code = 'empty' )]
0 commit comments