def test_time_field_raises_error_message(self):
        f = models.TimeField()
        # Wrong format
        self.assertRaises(ValidationError, f.clean, 'foo', None)
        try:
            f.clean('foo', None)
        except __HOLE__, e:
            self.assertEqual(e.messages, [
                u"'foo' value has an invalid format. It must be in "
                u"HH:MM[:ss[.uuuuuu]] format."])
        # Correct format but invalid time
        self.assertRaises(ValidationError, f.clean, '25:50', None)
        try:
            f.clean('25:50', None)
        except ValidationError, e:
            self.assertEqual(e.messages, [
                u"'25:50' value has the correct format "
                u"(HH:MM[:ss[.uuuuuu]]) but it is an invalid time."])
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/modeltests/validation/test_error_messages.py/ValidationMessagesTest.test_time_field_raises_error_message