Fixed #28393 -- Added helpful error messages for invalid AutoField/FloatField/IntegerField values.

Co-authored-by: Diederik van der Boor <vdboor@edoburu.nl>
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
This commit is contained in:
Diederik van der Boor 2017-07-13 13:55:23 +02:00 committed by Mariusz Felisiak
parent 1af469e67f
commit 25f21bd237
6 changed files with 97 additions and 4 deletions

View file

@ -3853,7 +3853,7 @@ class TestTicket24279(TestCase):
class TestInvalidValuesRelation(SimpleTestCase):
def test_invalid_values(self):
msg = "invalid literal for int() with base 10: 'abc'"
msg = "Field 'id' expected a number but got 'abc'."
with self.assertRaisesMessage(ValueError, msg):
Annotation.objects.filter(tag='abc')
with self.assertRaisesMessage(ValueError, msg):