1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

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

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)