diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-11 12:55:17 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-11 12:55:17 +0000 |
| commit | 121d2e36785dc0ce8e7d1c48883fc7b719b21afc (patch) | |
| tree | 7cddebe1474071a6fed69767378fc3433fd39dbb /tests/regressiontests/dispatch | |
| parent | 1070c57b83efdfd4fbed09280fcdaafc6d9c1a81 (diff) | |
Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/dispatch')
| -rw-r--r-- | tests/regressiontests/dispatch/tests/test_dispatcher.py | 17 | ||||
| -rw-r--r-- | tests/regressiontests/dispatch/tests/test_saferef.py | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/regressiontests/dispatch/tests/test_dispatcher.py b/tests/regressiontests/dispatch/tests/test_dispatcher.py index ad3a05f2cd..9ec800fc1b 100644 --- a/tests/regressiontests/dispatch/tests/test_dispatcher.py +++ b/tests/regressiontests/dispatch/tests/test_dispatcher.py @@ -1,7 +1,8 @@ -from django.dispatch import Signal -import unittest -import sys import gc +import sys + +from django.dispatch import Signal +from django.utils import unittest import django.utils.copycompat as copy if sys.platform.startswith('java'): @@ -20,7 +21,7 @@ def receiver_1_arg(val, **kwargs): class Callable(object): def __call__(self, val, **kwargs): return val - + def a(self, val, **kwargs): return val @@ -35,7 +36,7 @@ class DispatcherTests(unittest.TestCase): # force cleanup just in case signal.receivers = [] - + def testExact(self): a_signal.connect(receiver_1_arg, sender=self) expected = [(receiver_1_arg,"test")] @@ -51,7 +52,7 @@ class DispatcherTests(unittest.TestCase): self.assertEqual(result, expected) a_signal.disconnect(receiver_1_arg) self._testIsClean(a_signal) - + def testGarbageCollected(self): a = Callable() a_signal.connect(a.a, sender=self) @@ -61,7 +62,7 @@ class DispatcherTests(unittest.TestCase): result = a_signal.send(sender=self, val="test") self.assertEqual(result, expected) self._testIsClean(a_signal) - + def testMultipleRegistration(self): a = Callable() a_signal.connect(a) @@ -90,7 +91,7 @@ class DispatcherTests(unittest.TestCase): self.assertEqual(len(a_signal.receivers), 1) a_signal.disconnect(dispatch_uid = "uid") self._testIsClean(a_signal) - + def testRobust(self): """Test the sendRobust function""" def fails(val, **kwargs): diff --git a/tests/regressiontests/dispatch/tests/test_saferef.py b/tests/regressiontests/dispatch/tests/test_saferef.py index c0ec879a4b..1b773ebfef 100644 --- a/tests/regressiontests/dispatch/tests/test_saferef.py +++ b/tests/regressiontests/dispatch/tests/test_saferef.py @@ -1,6 +1,6 @@ from django.dispatch.saferef import * -import unittest +from django.utils import unittest class Test1(object): def x(self): |
