From 08d8bccbf1b0764a0de68325569ee47da256e206 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 13 Dec 2021 15:44:07 +0000 Subject: Improved Model.__init__() properties loop. This improves readability, accumulates unrecognized arguments raise an exception with all of them, and avoids refetching the values. --- tests/properties/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/properties') 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. -- cgit v1.2.1