summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-02-08 12:20:18 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-02-08 12:20:18 +0000
commit4e7c2ba1d7318d60cd371b98bf2afbaebd68acd5 (patch)
treef4976fbcd154661b8d0b117b0ee44c544e271220 /tests
parent74ffca17e2ca6a9f061913797efeebbc578692c5 (diff)
Cleaned up the tests from r15451 to avoid the need to retrieve a URL twice.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_views/tests.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 98a2d41ddc..d320db5644 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -441,7 +441,7 @@ class AdminJavaScriptTest(AdminViewBasicTest):
response,
'<script type="text/javascript">document.getElementById("id_name").focus();</script>'
)
-
+
def testMultiWidgetFirsFieldFocus(self):
"""
JavaScript-assisted auto-focus should work if a model/ModelAdmin setup
@@ -2619,11 +2619,10 @@ class DateHierarchyTests(TestCase):
settings.USE_THOUSAND_SEPARATOR = self.old_USE_THOUSAND_SEPARATOR
settings.USE_L10N = self.old_USE_L10N
- def assert_non_localized_year(self, url, year):
+ def assert_non_localized_year(self, response, year):
"""Ensure that the year is not localized with
USE_THOUSAND_SEPARATOR. Refs #15234.
"""
- response = self.client.get(url)
self.assertNotContains(response, formats.number_format(year))
def assert_contains_year_link(self, response, date):
@@ -2659,7 +2658,7 @@ class DateHierarchyTests(TestCase):
url = reverse('admin:admin_views_podcast_changelist')
response = self.client.get(url)
self.assert_contains_day_link(response, DATE)
- self.assert_non_localized_year(url, 2000)
+ self.assert_non_localized_year(response, 2000)
def test_within_month(self):
"""
@@ -2674,7 +2673,7 @@ class DateHierarchyTests(TestCase):
response = self.client.get(url)
for date in DATES:
self.assert_contains_day_link(response, date)
- self.assert_non_localized_year(url, 2000)
+ self.assert_non_localized_year(response, 2000)
def test_within_year(self):
"""
@@ -2691,7 +2690,7 @@ class DateHierarchyTests(TestCase):
self.assertNotContains(response, 'release_date__day=')
for date in DATES:
self.assert_contains_month_link(response, date)
- self.assert_non_localized_year(url, 2000)
+ self.assert_non_localized_year(response, 2000)
def test_multiple_years(self):
"""
@@ -2717,15 +2716,15 @@ class DateHierarchyTests(TestCase):
date.year)
response = self.client.get(url)
self.assert_contains_month_link(response, date)
- self.assert_non_localized_year(url, 2000)
- self.assert_non_localized_year(url, 2003)
- self.assert_non_localized_year(url, 2005)
+ self.assert_non_localized_year(response, 2000)
+ self.assert_non_localized_year(response, 2003)
+ self.assert_non_localized_year(response, 2005)
url = '%s?release_date__year=%d&release_date__month=%d' % (
reverse('admin:admin_views_podcast_changelist'),
date.year, date.month)
response = self.client.get(url)
self.assert_contains_day_link(response, date)
- self.assert_non_localized_year(url, 2000)
- self.assert_non_localized_year(url, 2003)
- self.assert_non_localized_year(url, 2005)
+ self.assert_non_localized_year(response, 2000)
+ self.assert_non_localized_year(response, 2003)
+ self.assert_non_localized_year(response, 2005)