summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-07-12 15:18:49 +0500
committerTim Graham <timograham@gmail.com>2017-07-12 09:11:48 -0400
commit30f334cc58e939c7d9bd8455c80bd066fbde9f2b (patch)
tree8905fc2e141a4bd8085102226d25e31afcf05049 /tests/utils_tests
parentfe7b4568255ae1f77c180404631d81ba6b2d996d (diff)
[1.11.x] Fixed #28389 -- Fixed pickling of LazyObject on Python 2 when wrapped object doesn't have __reduce__().
Partial revert of 35355a4ffedb2aeed52d5fe3034380ffc6a438db.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_lazyobject.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/utils_tests/test_lazyobject.py b/tests/utils_tests/test_lazyobject.py
index 9dc225b55f..c2a9855abf 100644
--- a/tests/utils_tests/test_lazyobject.py
+++ b/tests/utils_tests/test_lazyobject.py
@@ -187,11 +187,13 @@ class LazyObjectTestCase(TestCase):
def test_pickle(self):
# See ticket #16563
obj = self.lazy_wrap(Foo())
+ obj.bar = 'baz'
pickled = pickle.dumps(obj)
unpickled = pickle.loads(pickled)
self.assertIsInstance(unpickled, Foo)
self.assertEqual(unpickled, obj)
self.assertEqual(unpickled.foo, obj.foo)
+ self.assertEqual(unpickled.bar, obj.bar)
# Test copying lazy objects wrapping both builtin types and user-defined
# classes since a lot of the relevant code does __dict__ manipulation and