1
0
mirror of https://github.com/django/django.git synced 2024-12-24 10:05:46 +00:00

[py3] Fixed dispatch tests

This commit is contained in:
Claude Paroz 2012-08-15 18:19:21 +02:00
parent 27192564c3
commit 60f5e10230
2 changed files with 4 additions and 4 deletions

View File

@ -149,9 +149,11 @@ class BoundMethodWeakref(object):
self.selfName,
self.funcName,
)
__repr__ = __str__
__hash__ = object.__hash__
def __bool__( self ):
"""Whether we are still a valid reference"""
return self() is not None

View File

@ -54,10 +54,8 @@ class SaferefTests(unittest.TestCase):
sd[s] = 1
for t in self.ts:
if hasattr(t, 'x'):
self.assertTrue(sd.has_key(safeRef(t.x)))
self.assertTrue(safeRef(t.x) in sd)
else:
self.assertTrue(sd.has_key(safeRef(t)))
self.assertTrue(safeRef(t) in sd)
def testRepresentation(self):