  from django.test import TestCase
  from rest_framework import serializers
  
  
  def dedent(blocktext):
      return '\n'.join([line[12:] for line in blocktext.splitlines()[1:-1]])
  
 
</s> remove         instance = ModelClass.objects.create(**validated_attrs)
 </s> add         try:
            instance = ModelClass.objects.create(**validated_attrs)
        except TypeError as exc:
            msg = (
                'The mentioned argument might be a field on the serializer '
                'that is not part of the model. You need to override the '
                'create() method in your ModelSerializer subclass to support '
                'this.')
            six.reraise(
                type(exc),
                type(exc)(str(exc) + '. ' + msg),
                sys.exc_info()[2])
import pytest
  from django.test import TestCase
  from rest_framework import serializers
import pytest
  
  
  def dedent(blocktext):
      return '\n'.join([line[12:] for line in blocktext.splitlines()[1:-1]])
  
keep add keep keep keep keep keep
 More helpful error message when default `.create` fails. Closes #2013. 
tests/test_model_serializer.py