diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 6ab401bede..7b884345e1 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -448,24 +448,26 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
method in reverse order (i.e. admin_order_field uses the '-' prefix)
(column 6 is 'model_year_reverse' in ArticleAdmin)
"""
+ td = '
%s | '
+ td_2000, td_2008, td_2009 = td % 2000, td % 2008, td % 2009
response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '6'})
self.assertContentBefore(
- response, '2009', '2008',
+ response, td_2009, td_2008,
"Results of sorting on ModelAdmin method are out of order."
)
self.assertContentBefore(
- response, '2008', '2000',
+ response, td_2008, td_2000,
"Results of sorting on ModelAdmin method are out of order."
)
# Let's make sure the ordering is right and that we don't get a
# FieldError when we change to descending order
response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '-6'})
self.assertContentBefore(
- response, '2000', '2008',
+ response, td_2000, td_2008,
"Results of sorting on ModelAdmin method are out of order."
)
self.assertContentBefore(
- response, '2008', '2009',
+ response, td_2008, td_2009,
"Results of sorting on ModelAdmin method are out of order."
)