diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
| commit | afd040d4d3a06fe92e3080870b2ff2095ce86a75 (patch) | |
| tree | bda969614999a3fcfbf1466caa0d75e512dd1374 /tests/regressiontests/dispatch | |
| parent | b7c41c1fbb2d45634dde5f7a450ba1a5aea5a8af (diff) | |
Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
assertEquals -> assertEqual
failUnless -> assertTrue
For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/dispatch')
| -rw-r--r-- | tests/regressiontests/dispatch/tests/test_dispatcher.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/dispatch/tests/test_saferef.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/regressiontests/dispatch/tests/test_dispatcher.py b/tests/regressiontests/dispatch/tests/test_dispatcher.py index 9ec800fc1b..2ad5b0c67a 100644 --- a/tests/regressiontests/dispatch/tests/test_dispatcher.py +++ b/tests/regressiontests/dispatch/tests/test_dispatcher.py @@ -99,7 +99,7 @@ class DispatcherTests(unittest.TestCase): a_signal.connect(fails) result = a_signal.send_robust(sender=self, val="test") err = result[0][1] - self.assert_(isinstance(err, ValueError)) + self.assertTrue(isinstance(err, ValueError)) self.assertEqual(err.args, ('this',)) a_signal.disconnect(fails) self._testIsClean(a_signal) diff --git a/tests/regressiontests/dispatch/tests/test_saferef.py b/tests/regressiontests/dispatch/tests/test_saferef.py index 1b773ebfef..c8cfd6cce1 100644 --- a/tests/regressiontests/dispatch/tests/test_saferef.py +++ b/tests/regressiontests/dispatch/tests/test_saferef.py @@ -40,12 +40,12 @@ class Tester(unittest.TestCase): def testIn(self): """Test the "in" operator for safe references (cmp)""" for t in self.ts[:50]: - self.assert_(safeRef(t.x) in self.ss) + 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.assert_(s()) + self.assertTrue(s()) def testShortCircuit (self): """Test that creation short-circuits to reuse existing references""" @@ -54,11 +54,11 @@ class Tester(unittest.TestCase): sd[s] = 1 for t in self.ts: if hasattr(t, 'x'): - self.assert_(sd.has_key(safeRef(t.x))) - self.assert_(safeRef(t.x) in sd) + self.assertTrue(sd.has_key(safeRef(t.x))) + self.assertTrue(safeRef(t.x) in sd) else: - self.assert_(sd.has_key(safeRef(t))) - self.assert_(safeRef(t) in sd) + self.assertTrue(sd.has_key(safeRef(t))) + self.assertTrue(safeRef(t) in sd) def testRepresentation (self): """Test that the reference object's representation works |
