diff options
author | Adam Johnson <me@adamj.eu> | 2021-12-13 15:44:07 +0000 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-01-13 11:09:37 +0100 |
commit | 08d8bccbf1b0764a0de68325569ee47da256e206 (patch) | |
tree | f5efe9496dedba0f7744ba87c5ef807b1b7d1fe8 /tests/properties | |
parent | 0a4a5e5bacc354df3132d0fcf706839c21afb89d (diff) | |
download | django-08d8bccbf1b0764a0de68325569ee47da256e206.tar.gz |
Improved Model.__init__() properties loop.
This improves readability, accumulates unrecognized arguments raise an
exception with all of them, and avoids refetching the values.
Diffstat (limited to 'tests/properties')
-rw-r--r-- | tests/properties/tests.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/properties/tests.py b/tests/properties/tests.py index ce29668644..dd7a6287d6 100644 --- a/tests/properties/tests.py +++ b/tests/properties/tests.py @@ -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, "Person() got an unexpected keyword argument 'full_name'"): + with self.assertRaises(AttributeError): Person(full_name='Paul McCartney') # But "full_name_2" has, and it can be used to initialize the class. |