              message = serializers.UUIDField(required=False)
  
          serializer = TestSerializer(data=QueryDict('message='))
          assert serializer.is_valid()
          assert list(serializer.validated_data.keys()) == []
  
      def test_empty_html_charfield_allow_null(self):
          class TestSerializer(serializers.Serializer):
              message = serializers.CharField(allow_null=True)
  
 
</s> remove         assert list(serializer.validated_data.keys()) == ['message']
 </s> add         assert list(serializer.validated_data) == ['message'] </s> remove         assert list(request.POST.keys()) == []
        assert list(request.FILES.keys()) == ['upload']
 </s> add         assert list(request.POST) == []
        assert list(request.FILES) == ['upload'] </s> remove         assert 'text' not in serializer.fields.keys()
 </s> add         assert 'text' not in serializer.fields </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'}
        assert list(serializer.validated_data) == []
              message = serializers.UUIDField(required=False)
  
          serializer = TestSerializer(data=QueryDict('message='))
          assert serializer.is_valid()
        assert list(serializer.validated_data) == []
  
      def test_empty_html_charfield_allow_null(self):
          class TestSerializer(serializers.Serializer):
              message = serializers.CharField(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_fields.py