      """
          Tests for CharField
      """
      def test_none_serializing(self):
          class CharFieldSerializer(serializers.ModelSerializer):
              class Meta:
                  model = NullableCharFieldModel
          serializer = CharFieldSerializer(data={'char': None})
          self.assertTrue(serializer.fields['char'].allow_none)
          self.assertTrue(serializer.is_valid())
          self.assertIsNone(serializer.object.char)
  
 
</s> remove class NullableCharFieldModel(models.Model):
    char = models.CharField(null=True, blank=True, max_length=4)


 </s> add  </s> remove         self.assertIsNone(serializer.object.char)
 </s> add         self.assertIsNone(serializer.object['char']) </s> remove                 # return None explicitly because smart_text(None) == 'None'
                # see #1834 for details
 </s> add                 # Return None explicitly because smart_text(None) == 'None'. See #1834 for details
        class CharFieldSerializer(serializers.Serializer):
            char = serializers.CharField(allow_none=True, required=False)
      """
          Tests for CharField
      """
      def test_none_serializing(self):
        class CharFieldSerializer(serializers.Serializer):
            char = serializers.CharField(allow_none=True, required=False)
        class CharFieldSerializer(serializers.Serializer):
            char = serializers.CharField(allow_none=True, required=False)
        class CharFieldSerializer(serializers.Serializer):
            char = serializers.CharField(allow_none=True, required=False)
          serializer = CharFieldSerializer(data={'char': None})
          self.assertTrue(serializer.fields['char'].allow_none)
          self.assertTrue(serializer.is_valid())
          self.assertIsNone(serializer.object.char)
  
keep keep keep keep replace replace replace keep keep keep keep keep
 Use Serializer instead of ModelSerializer 
tests/test_fields.py