Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 4e7c2ba1d7318d60cd371b98bf2afbaebd68acd5 1 parent 74ffca1
@freakboy3742 freakboy3742 authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 tests/regressiontests/admin_views/tests.py
View
23 tests/regressiontests/admin_views/tests.py
@@ -441,7 +441,7 @@ def testSingleWidgetFirsFieldFocus(self):
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 @@ def tearDown(self):
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 @@ def test_single(self):
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 @@ def test_within_month(self):
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 @@ def test_within_year(self):
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 @@ def test_multiple_years(self):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.