          self.assertEquals(serializer.is_valid(), False)
  
          self.assertIn('created', serializer.errors)
  
  
  class CustomValidationTests(TestCase):
      class CommentSerializerWithFieldValidator(CommentSerializer):
  
          def validate_email(self, attrs, source):
 
</s>
    def test_missing_model_field_exception_msg(self):
        """
        Assert that a meaningful exception message is outputted when the model
        field is missing (e.g. when mistyping ``model``).
        """
        try:
            serializer = BrokenModelSerializer()
        except AttributeError as e:
            self.assertEquals(e.args[0], "Serializer class is missing 'model' Meta option")
        except:
            self.fail('Wrong exception type thrown.')

          self.assertEquals(serializer.is_valid(), False)
  
          self.assertIn('created', serializer.errors)
  
    def test_missing_model_field_exception_msg(self):
        """
        Assert that a meaningful exception message is outputted when the model
        field is missing (e.g. when mistyping ``model``).
        """
        try:
            serializer = BrokenModelSerializer()
        except AttributeError as e:
            self.assertEquals(e.args[0], "Serializer class is missing 'model' Meta option")
        except:
            self.fail('Wrong exception type thrown.')

  
  class CustomValidationTests(TestCase):
      class CommentSerializerWithFieldValidator(CommentSerializer):
  
          def validate_email(self, attrs, source):
keep keep keep add keep keep keep keep keep
 Improved exception message for missing serializer model meta option
rest_framework/tests/serializer.py