summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-11-19 03:00:02 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-11-19 03:00:02 (GMT)
commitdc3c239b1ef694b36c79008cdb86ed18852f63c1 (patch)
tree56525a6dfc066fc13bf7a1ce341c85fef4608a11 /Lib/test
parent9eac119ba8f9fd6d76b75689baaa656a979cc260 (diff)
downloadcpython-dc3c239b1ef694b36c79008cdb86ed18852f63c1.zip
cpython-dc3c239b1ef694b36c79008cdb86ed18852f63c1.tar.gz
cpython-dc3c239b1ef694b36c79008cdb86ed18852f63c1.tar.bz2
#5037 proxy __unicode__ correctly
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_weakref.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index ed63147..2106d8c 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -188,6 +188,17 @@ class ReferencesTestCase(TestBase):
self.assertEqual(L3[:5], p3[:5])
self.assertEqual(L3[2:5], p3[2:5])
+ def test_proxy_unicode(self):
+ # See bug 5037
+ class C(object):
+ def __str__(self):
+ return "string"
+ def __unicode__(self):
+ return u"unicode"
+ instance = C()
+ self.assertTrue("__unicode__" in dir(weakref.proxy(instance)))
+ self.assertEqual(unicode(weakref.proxy(instance)), u"unicode")
+
def test_proxy_index(self):
class C:
def __index__(self):