|
@@ -99,6 +99,16 @@ class ListViewTests(TestCase):
|
|
|
# Custom pagination allows for 2 orphans on a page size of 5
|
|
|
self.assertEqual(len(res.context['object_list']), 7)
|
|
|
|
|
|
+ def test_paginated_custom_page_kwarg(self):
|
|
|
+ self._make_authors(100)
|
|
|
+ res = self.client.get('/list/authors/paginated/custom_page_kwarg/', {'pagina': '2'})
|
|
|
+ self.assertEqual(res.status_code, 200)
|
|
|
+ self.assertTemplateUsed(res, 'generic_views/author_list.html')
|
|
|
+ self.assertEqual(len(res.context['object_list']), 30)
|
|
|
+ self.assertIs(res.context['author_list'], res.context['object_list'])
|
|
|
+ self.assertEqual(res.context['author_list'][0].name, 'Author 30')
|
|
|
+ self.assertEqual(res.context['page_obj'].number, 2)
|
|
|
+
|
|
|
def test_paginated_custom_paginator_constructor(self):
|
|
|
self._make_authors(7)
|
|
|
res = self.client.get('/list/authors/paginated/custom_constructor/')
|