diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-15 18:19:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-15 18:19:21 +0200 |
| commit | 60f5e1023066b92270d01aa121efe228f6edc379 (patch) | |
| tree | 5954749e59963fe92a4f30062a049f46d1b110a9 | |
| parent | 27192564c3193a54165752e8803b4d7b635f9022 (diff) | |
[py3] Fixed dispatch tests
| -rw-r--r-- | django/dispatch/saferef.py | 6 | ||||
| -rw-r--r-- | tests/regressiontests/dispatch/tests/test_saferef.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py index d8728e219a..84d1b2183c 100644 --- a/django/dispatch/saferef.py +++ b/django/dispatch/saferef.py @@ -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 diff --git a/tests/regressiontests/dispatch/tests/test_saferef.py b/tests/regressiontests/dispatch/tests/test_saferef.py index cfe6c5df85..30eaddfe18 100644 --- a/tests/regressiontests/dispatch/tests/test_saferef.py +++ b/tests/regressiontests/dispatch/tests/test_saferef.py @@ -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): |
