Fixed #29517 -- Rephrased error message when passing incorrect kwarg to model constructor

This commit is contained in:
Federico Bond 2018-06-25 09:30:58 +02:00 committed by Claude Paroz
parent 02cd16a7a0
commit 4c36414323
3 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ class PropertyTests(TestCase):
setattr(self.a, 'full_name', 'Paul McCartney')
# And cannot be used to initialize the class.
with self.assertRaisesMessage(TypeError, "'full_name' is an invalid keyword argument"):
with self.assertRaisesMessage(TypeError, "Person() got an unexpected keyword argument 'full_name'"):
Person(full_name='Paul McCartney')
# But "full_name_2" has, and it can be used to initialize the class.