Ticket #15575: is_paginated.2.diff

File is_paginated.2.diff, 1.3 KB (added by Ivan Virabyan, 14 years ago)

patch was improved, test added

  • django/views/generic/list.py

     
    4747                raise Http404(_(u"Page is not 'last', nor can it be converted to an int."))
    4848        try:
    4949            page = paginator.page(page_number)
    50             return (paginator, page, page.object_list, True)
     50            return (paginator, page, page.object_list, page.has_other_pages())
    5151        except InvalidPage:
    5252            raise Http404(_(u'Invalid page (%(page_number)s)') % {
    5353                                'page_number': page_number
  • tests/regressiontests/generic_views/list.py

     
    4646        self.assertIs(res.context['author_list'], res.context['object_list'])
    4747        self.assertEqual(res.context['page_obj'].number, 1)
    4848        self.assertEqual(res.context['paginator'].num_pages, 1)
    49         self.assertTrue(res.context['is_paginated'])
     49        self.assertFalse(res.context['is_paginated'])
    5050
    5151    def test_paginated_get_page_by_query_string(self):
    5252        self._make_authors(100)
Back to Top