Ticket #16218: django-16218.asctest.diff

File django-16218.asctest.diff, 777 bytes (added by Bas Peschier, 13 years ago)
  • tests/regressiontests/generic_views/dates.py

    diff -r 41ee28cb9212 tests/regressiontests/generic_views/dates.py
    a b  
    7676        self.assertEqual(res.context['page_obj'].number, 2)
    7777        self.assertEqual(list(res.context['latest']), list(Book.objects.all()[10:20]))
    7878
     79    def test_date_list_order(self):
     80        """ date_list should be ascending """
     81        self._make_books(20, base_date=datetime.date.today())
     82        res = self.client.get('/dates/books/')
     83        self.assertEqual(res.context['date_list'], list(sorted(res.context['date_list'])))
    7984
    8085class YearArchiveViewTests(TestCase):
    8186    fixtures = ['generic-views-test-data.json']
Back to Top