1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

[1.8.x] Fixed #23285 -- Fixed non-deterministic admin_views test.

This test sometimes fail because the checked integers can appear in the
output as memory addresses due to #24316.

Backport of 2939ed4a18864549a25807193ea5af490d632dc6 from stable/1.9.x
This commit is contained in:
Tim Graham 2015-12-28 17:36:04 -05:00
parent b51086d573
commit 11601ee826

View File

@ -299,16 +299,16 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
(column 6 is 'model_year_reverse' in ArticleAdmin) (column 6 is 'model_year_reverse' in ArticleAdmin)
""" """
response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '6'}) response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '6'})
self.assertContentBefore(response, '2009', '2008', self.assertContentBefore(response, '2009,', '2008,',
"Results of sorting on ModelAdmin method are out of order.") "Results of sorting on ModelAdmin method are out of order.")
self.assertContentBefore(response, '2008', '2000', self.assertContentBefore(response, '2008,', '2000,',
"Results of sorting on ModelAdmin method are out of order.") "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 # Let's make sure the ordering is right and that we don't get a
# FieldError when we change to descending order # FieldError when we change to descending order
response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '-6'}) response = self.client.get(reverse('admin:admin_views_article_changelist'), {'o': '-6'})
self.assertContentBefore(response, '2000', '2008', self.assertContentBefore(response, '2000,', '2008,',
"Results of sorting on ModelAdmin method are out of order.") "Results of sorting on ModelAdmin method are out of order.")
self.assertContentBefore(response, '2008', '2009', self.assertContentBefore(response, '2008,', '2009,',
"Results of sorting on ModelAdmin method are out of order.") "Results of sorting on ModelAdmin method are out of order.")
def test_change_list_sorting_multiple(self): def test_change_list_sorting_multiple(self):