              amount = serializers.IntegerField()
  
          serializer = ExampleSerializer()
          del serializer.fields['text']
          assert 'text' not in serializer.fields.keys()
  
      def test_as_form_fields(self):
          class ExampleSerializer(serializers.Serializer):
              bool_field = serializers.BooleanField()
              null_field = serializers.IntegerField(allow_null=True)
 
</s> remove         assert list(serializer.validated_data.keys()) == []
 </s> add         assert list(serializer.validated_data) == [] </s> remove         assert list(serializer.validated_data.keys()) == ['message']
 </s> add         assert list(serializer.validated_data) == ['message'] </s> remove         assert set(serializer.data.keys()) == {'name', 'ref'}
 </s> add         assert set(serializer.data) == {'name', 'ref'} </s> remove         assert set(serializer.data.keys()) == {'name1', 'name2', 'id'}
 </s> add         assert set(serializer.data) == {'name1', 'name2', 'id'} </s> remove         assert list(response.data['actions'].keys()) == ['PUT']
 </s> add         assert list(response.data['actions']) == ['PUT']
        assert 'text' not in serializer.fields
              amount = serializers.IntegerField()
  
          serializer = ExampleSerializer()
          del serializer.fields['text']
        assert 'text' not in serializer.fields
  
      def test_as_form_fields(self):
          class ExampleSerializer(serializers.Serializer):
              bool_field = serializers.BooleanField()
              null_field = serializers.IntegerField(allow_null=True)
keep keep keep keep replace keep keep keep keep keep
 Perfer iter(dict) over iter(dict.keys()) (#5736)

Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I 
tests/test_bound_fields.py