Increased test coverage of django.utils.inspect.

This commit is contained in:
Mads Jensen 2019-12-23 11:56:51 +01:00 committed by Mariusz Felisiak
parent e42b68debf
commit 62727e65fb
1 changed files with 8 additions and 0 deletions

View File

@ -39,3 +39,11 @@ class TestInspectMethods(unittest.TestCase):
self.assertIs(inspect.method_has_no_args(Person.one_argument), False)
self.assertIs(inspect.method_has_no_args(Person().no_arguments), True)
self.assertIs(inspect.method_has_no_args(Person().one_argument), False)
def test_func_supports_parameter(self):
self.assertIs(inspect.func_supports_parameter(Person.all_kinds, 'address'), True)
self.assertIs(inspect.func_supports_parameter(Person.all_kinds, 'zone'), False)
def test_func_accepts_kwargs(self):
self.assertIs(inspect.func_accepts_kwargs(Person.just_args), False)
self.assertIs(inspect.func_accepts_kwargs(Person.all_kinds), True)