summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/utils/simplelazyobject.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/simplelazyobject.py b/tests/regressiontests/utils/simplelazyobject.py
index 8a02f52fb6..4ee822563e 100644
--- a/tests/regressiontests/utils/simplelazyobject.py
+++ b/tests/regressiontests/utils/simplelazyobject.py
@@ -1,4 +1,5 @@
import copy
+import pickle
from django.utils.unittest import TestCase
from django.utils.functional import SimpleLazyObject, empty
@@ -96,3 +97,12 @@ class TestUtilsSimpleLazyObject(TestCase):
self.assertTrue(x)
x = SimpleLazyObject(lambda: 0)
self.assertFalse(x)
+
+ def test_pickle_complex(self):
+ # See ticket #16563
+ x = SimpleLazyObject(complex_object)
+ pickled = pickle.dumps(x)
+ unpickled = pickle.loads(pickled)
+ self.assertEqual(unpickled, x)
+ self.assertEqual(unicode(unpickled), unicode(x))
+ self.assertEqual(unpickled.name, x.name)