1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

[3.2.x] Refs #31732 -- Fixed django.utils.inspect caching for bound methods.

Thanks Alexandr Artemyev for the report, and Simon Charette for the
original patch.

Backport of 562898034f from main
This commit is contained in:
Adam Johnson
2021-03-19 11:23:28 +00:00
committed by Mariusz Felisiak
parent 2420fd2d5c
commit 15a8518388
2 changed files with 31 additions and 12 deletions

View File

@@ -22,6 +22,16 @@ class Person:
class TestInspectMethods(unittest.TestCase):
def test_get_callable_parameters(self):
self.assertIs(
inspect._get_callable_parameters(Person.no_arguments),
inspect._get_callable_parameters(Person.no_arguments),
)
self.assertIs(
inspect._get_callable_parameters(Person().no_arguments),
inspect._get_callable_parameters(Person().no_arguments),
)
def test_get_func_full_args_no_arguments(self):
self.assertEqual(inspect.get_func_full_args(Person.no_arguments), [])
self.assertEqual(inspect.get_func_full_args(Person().no_arguments), [])