summaryrefslogtreecommitdiff
path: root/tests/regressiontests/dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/dispatch')
-rw-r--r--tests/regressiontests/dispatch/tests/test_saferef.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/regressiontests/dispatch/tests/test_saferef.py b/tests/regressiontests/dispatch/tests/test_saferef.py
index c8cfd6cce1..fecded69a5 100644
--- a/tests/regressiontests/dispatch/tests/test_saferef.py
+++ b/tests/regressiontests/dispatch/tests/test_saferef.py
@@ -1,7 +1,7 @@
-from django.dispatch.saferef import *
-
+from django.dispatch.saferef import safeRef
from django.utils import unittest
+
class Test1(object):
def x(self):
pass
@@ -32,21 +32,21 @@ class Tester(unittest.TestCase):
self.ts = ts
self.ss = ss
self.closureCount = 0
-
+
def tearDown(self):
del self.ts
del self.ss
-
+
def testIn(self):
"""Test the "in" operator for safe references (cmp)"""
for t in self.ts[:50]:
self.assertTrue(safeRef(t.x) in self.ss)
-
+
def testValid(self):
"""Test that the references are valid (return instance methods)"""
for s in self.ss:
self.assertTrue(s())
-
+
def testShortCircuit (self):
"""Test that creation short-circuits to reuse existing references"""
sd = {}
@@ -59,15 +59,15 @@ class Tester(unittest.TestCase):
else:
self.assertTrue(sd.has_key(safeRef(t)))
self.assertTrue(safeRef(t) in sd)
-
+
def testRepresentation (self):
"""Test that the reference object's representation works
-
+
XXX Doesn't currently check the results, just that no error
is raised
"""
repr(self.ss[-1])
-
+
def _closure(self, ref):
"""Dumb utility mechanism to increment deletion counter"""
self.closureCount +=1