Code

Ticket #16218: django-16218.asctest.diff

File django-16218.asctest.diff, 777 bytes (added by bpeschier, 3 years ago)
Line 
1diff -r 41ee28cb9212 tests/regressiontests/generic_views/dates.py
2--- a/tests/regressiontests/generic_views/dates.py      Wed Jun 15 23:52:44 2011 +0000
3+++ b/tests/regressiontests/generic_views/dates.py      Thu Jun 16 12:58:34 2011 +0200
4@@ -76,6 +76,11 @@
5         self.assertEqual(res.context['page_obj'].number, 2)
6         self.assertEqual(list(res.context['latest']), list(Book.objects.all()[10:20]))
7 
8+    def test_date_list_order(self):
9+        """ date_list should be ascending """
10+        self._make_books(20, base_date=datetime.date.today())
11+        res = self.client.get('/dates/books/')
12+        self.assertEqual(res.context['date_list'], list(sorted(res.context['date_list'])))
13 
14 class YearArchiveViewTests(TestCase):
15     fixtures = ['generic-views-test-data.json']