          ret = SortedDict()
          model = getattr(self.Meta, 'model')
          fields = getattr(self.Meta, 'fields', None)
          depth = getattr(self.Meta, 'depth', 0)
  
          # Retrieve metadata about fields & relationships on the model class.
          info = model_meta.get_field_info(model)
  
 
</s> remove             else:
                assert False, 'Field name `%s` is not valid.' % field_name
 </s> add             elif hasattr(model, field_name):
                # Create a read only field for model methods and properties.
                field_cls = ReadOnlyField
                kwargs = {} </s> remove from django.core.exceptions import ValidationError
 </s> add from django.core.exceptions import ImproperlyConfigured, ValidationError
        extra_kwargs = getattr(self.Meta, 'extra_kwargs', {})
          ret = SortedDict()
          model = getattr(self.Meta, 'model')
          fields = getattr(self.Meta, 'fields', None)
          depth = getattr(self.Meta, 'depth', 0)
        extra_kwargs = getattr(self.Meta, 'extra_kwargs', {})
  
          # Retrieve metadata about fields & relationships on the model class.
          info = model_meta.get_field_info(model)
  
keep keep keep add keep keep keep keep
 Configuration correctness tests on ModelSerializer 
rest_framework/serializers.py