'Tests that paginator pages have the correct start and end indexes.'

def test_page_indexes(self):

    ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    tests = (((ten, 1, 0, True), (1, 1), (10, 10)), ((ten, 2, 0, True), (1, 2), (9, 10)), ((ten, 3, 0, True), (1, 3), (10, 10)), ((ten, 5, 0, True), (1, 5), (6, 10)), ((ten, 1, 1, True), (1, 1), (9, 10)), ((ten, 1, 2, True), (1, 1), (8, 10)), ((ten, 3, 1, True), (1, 3), (7, 10)), ((ten, 3, 2, True), (1, 3), (7, 10)), ((ten, 3, 4, True), (1, 3), (4, 10)), ((ten, 5, 1, True), (1, 5), (6, 10)), ((ten, 5, 2, True), (1, 5), (6, 10)), ((ten, 5, 5, True), (1, 10), (1, 10)), (([1], 4, 0, False), (1, 1), (1, 1)), (([1], 4, 1, False), (1, 1), (1, 1)), (([1], 4, 2, False), (1, 1), (1, 1)), (([1], 4, 0, True), (1, 1), (1, 1)), (([1], 4, 1, True), (1, 1), (1, 1)), (([1], 4, 2, True), (1, 1), (1, 1)), (([], 4, 0, True), (0, 0), (0, 0)), (([], 4, 1, True), (0, 0), (0, 0)), (([], 4, 2, True), (0, 0), (0, 0)))
    for (params, first, last) in tests:
        self.check_indexes(params, 'first', first)
        self.check_indexes(params, 'last', last)
    self.assertRaises(EmptyPage, self.check_indexes, ([], 4, 0, False), 1, None)
    self.assertRaises(EmptyPage, self.check_indexes, ([], 4, 1, False), 1, None)
    self.assertRaises(EmptyPage, self.check_indexes, ([], 4, 2, False), 1, None)
