|
@@ -77,6 +77,19 @@ class IntFlagEnum(enum.IntFlag):
|
|
|
B = 2
|
|
|
|
|
|
|
|
|
+def decorator(f):
|
|
|
+ @functools.wraps(f)
|
|
|
+ def wrapper(*args, **kwargs):
|
|
|
+ return f(*args, **kwargs)
|
|
|
+
|
|
|
+ return wrapper
|
|
|
+
|
|
|
+
|
|
|
+@decorator
|
|
|
+def function_with_decorator():
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
class OperationWriterTests(SimpleTestCase):
|
|
|
def test_empty_signature(self):
|
|
|
operation = custom_migration_operations.operations.TestOperation()
|
|
@@ -566,6 +579,9 @@ class WriterTests(SimpleTestCase):
|
|
|
self.assertEqual(string, "models.SET(42)")
|
|
|
self.serialize_round_trip(models.SET(42))
|
|
|
|
|
|
+ def test_serialize_decorated_functions(self):
|
|
|
+ self.assertSerializedEqual(function_with_decorator)
|
|
|
+
|
|
|
def test_serialize_datetime(self):
|
|
|
self.assertSerializedEqual(datetime.datetime.now())
|
|
|
self.assertSerializedEqual(datetime.datetime.now)
|