def test_autofield_field_raises_error_message(self):
        f = models.AutoField(primary_key=True)
        self.assertRaises(ValidationError, f.clean, 'foo', None)
        try:
            f.clean('foo', None)
        except ValidationError, e:
            self.assertEqual(e.messages, [u"'foo' value must be an integer."])
        # primary_key must be True. Refs #12467.
        self.assertRaises(AssertionError, models.AutoField, 'primary_key', False)
        try:
            models.AutoField(primary_key=False)
        except __HOLE__, e:
            self.assertEqual(str(e), "AutoFields must have primary_key=True.")
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/modeltests/validation/test_error_messages.py/ValidationMessagesTest.test_autofield_field_raises_error_message