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/templates/custom.py | |
| 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/templates/custom.py')
| -rw-r--r-- | tests/regressiontests/templates/custom.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/regressiontests/templates/custom.py b/tests/regressiontests/templates/custom.py index a517bd1810..15f625dbd5 100644 --- a/tests/regressiontests/templates/custom.py +++ b/tests/regressiontests/templates/custom.py @@ -13,27 +13,27 @@ class CustomFilterTests(TestCase): class CustomTagTests(TestCase): def verify_tag(self, tag, name): - self.assertEquals(tag.__name__, name) - self.assertEquals(tag.__doc__, 'Expected %s __doc__' % name) - self.assertEquals(tag.__dict__['anything'], 'Expected %s __dict__' % name) + self.assertEqual(tag.__name__, name) + self.assertEqual(tag.__doc__, 'Expected %s __doc__' % name) + self.assertEqual(tag.__dict__['anything'], 'Expected %s __dict__' % name) def test_simple_tags(self): c = template.Context({'value': 42}) t = template.Template('{% load custom %}{% no_params %}') - self.assertEquals(t.render(c), u'no_params - Expected result') + self.assertEqual(t.render(c), u'no_params - Expected result') t = template.Template('{% load custom %}{% one_param 37 %}') - self.assertEquals(t.render(c), u'one_param - Expected result: 37') + self.assertEqual(t.render(c), u'one_param - Expected result: 37') t = template.Template('{% load custom %}{% explicit_no_context 37 %}') - self.assertEquals(t.render(c), u'explicit_no_context - Expected result: 37') + self.assertEqual(t.render(c), u'explicit_no_context - Expected result: 37') t = template.Template('{% load custom %}{% no_params_with_context %}') - self.assertEquals(t.render(c), u'no_params_with_context - Expected result (context value: 42)') + self.assertEqual(t.render(c), u'no_params_with_context - Expected result (context value: 42)') t = template.Template('{% load custom %}{% params_and_context 37 %}') - self.assertEquals(t.render(c), u'params_and_context - Expected result (context value: 42): 37') + self.assertEqual(t.render(c), u'params_and_context - Expected result (context value: 42): 37') def test_simple_tag_registration(self): # Test that the decorators preserve the decorated function's docstring, name and attributes. |
