Minor renaming for consistency.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16179 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-05-07 17:05:06 +00:00
parent 2abd7af4dd
commit 32bd953e63
3 changed files with 16 additions and 16 deletions

View File

@ -82,7 +82,7 @@ class FlatpageMiddlewareTests(TestCase):
fp.sites.add(1)
response = self.client.get('/some.very_special~chars-here/')
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Isn't it special!</p>")
@ -121,7 +121,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase):
def test_redirect_view_non_existent_flatpage(self):
"A non-existent flatpage raises 404 when served through a view and should not add a slash"
response = self.client.get('/flatpage_root/no_such_flatpage')
self.assertEquals(response.status_code, 404)
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_flatpage(self):
"A flatpage can be served by the fallback middlware and should add a slash"
@ -131,7 +131,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase):
def test_redirect_fallback_non_existent_flatpage(self):
"A non-existent flatpage raises a 404 when served by the fallback middlware and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEquals(response.status_code, 404)
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_flatpage_special_chars(self):
"A flatpage with special chars in the URL can be served by the fallback middleware and should add a slash"
@ -159,7 +159,7 @@ class FlatpageMiddlewareAppendSlashTests(TestCase):
fp.sites.add(1)
response = self.client.get('/')
self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Root</p>")

View File

@ -110,17 +110,17 @@ class FlatpageViewAppendSlashTests(TestCase):
def test_redirect_view_non_existent_flatpage(self):
"A non-existent flatpage raises 404 when served through a view and should not add a slash"
response = self.client.get('/flatpage_root/no_such_flatpage')
self.assertEquals(response.status_code, 404)
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_flatpage(self):
"A fallback flatpage won't be served if the middleware is disabled and should not add a slash"
response = self.client.get('/flatpage')
self.assertEquals(response.status_code, 404)
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_non_existent_flatpage(self):
"A non-existent flatpage won't be served if the fallback middlware is disabled and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEquals(response.status_code, 404)
self.assertEqual(response.status_code, 404)
def test_redirect_view_flatpage_special_chars(self):
"A flatpage with special chars in the URL can be served through a view and should add a slash"

View File

@ -59,19 +59,19 @@ class CustomTagTests(TestCase):
c = template.Context({'value': 42})
t = template.Template('{% load custom %}{% inclusion_no_params %}')
self.assertEquals(t.render(c), u'inclusion_no_params - Expected result\n')
self.assertEqual(t.render(c), u'inclusion_no_params - Expected result\n')
t = template.Template('{% load custom %}{% inclusion_one_param 37 %}')
self.assertEquals(t.render(c), u'inclusion_one_param - Expected result: 37\n')
self.assertEqual(t.render(c), u'inclusion_one_param - Expected result: 37\n')
t = template.Template('{% load custom %}{% inclusion_explicit_no_context 37 %}')
self.assertEquals(t.render(c), u'inclusion_explicit_no_context - Expected result: 37\n')
self.assertEqual(t.render(c), u'inclusion_explicit_no_context - Expected result: 37\n')
t = template.Template('{% load custom %}{% inclusion_no_params_with_context %}')
self.assertEquals(t.render(c), u'inclusion_no_params_with_context - Expected result (context value: 42)\n')
self.assertEqual(t.render(c), u'inclusion_no_params_with_context - Expected result (context value: 42)\n')
t = template.Template('{% load custom %}{% inclusion_params_and_context 37 %}')
self.assertEquals(t.render(c), u'inclusion_params_and_context - Expected result (context value: 42): 37\n')
self.assertEqual(t.render(c), u'inclusion_params_and_context - Expected result (context value: 42): 37\n')
def test_inclusion_tag_registration(self):
# Test that the decorators preserve the decorated function's docstring, name and attributes.
@ -88,10 +88,10 @@ class CustomTagTests(TestCase):
"""
c = template.Context({})
t = template.Template('{% load custom %}{% inclusion_tag_current_app %}')
self.assertEquals(t.render(c).strip(), u'None')
self.assertEqual(t.render(c).strip(), u'None')
c.current_app = 'advanced'
self.assertEquals(t.render(c).strip(), u'advanced')
self.assertEqual(t.render(c).strip(), u'advanced')
def test_15070_use_l10n(self):
"""
@ -100,10 +100,10 @@ class CustomTagTests(TestCase):
"""
c = template.Context({})
t = template.Template('{% load custom %}{% inclusion_tag_use_l10n %}')
self.assertEquals(t.render(c).strip(), u'None')
self.assertEqual(t.render(c).strip(), u'None')
c.use_l10n = True
self.assertEquals(t.render(c).strip(), u'True')
self.assertEqual(t.render(c).strip(), u'True')
def test_assignment_tags(self):
c = template.Context({'value': 42})