mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Normalized decorator style for functools.wraps.
This commit is contained in:
committed by
Mariusz Felisiak
parent
aff649a3bd
commit
8cf4de206c
@@ -159,10 +159,11 @@ class DecoratorsTest(TestCase):
|
||||
# For testing method_decorator, a decorator that assumes a single argument.
|
||||
# We will get type arguments if there is a mismatch in the number of arguments.
|
||||
def simple_dec(func):
|
||||
@wraps(func)
|
||||
def wrapper(arg):
|
||||
return func("test:" + arg)
|
||||
|
||||
return wraps(func)(wrapper)
|
||||
return wrapper
|
||||
|
||||
|
||||
simple_dec_m = method_decorator(simple_dec)
|
||||
|
||||
Reference in New Issue
Block a user