Ejemplo n.º 1
0
def test_next_page_stays_at_last_page():
    row = ["Paul", "12"]
    paginator = Paginator(header=[], rows=[row, row, row, row, row,
                                           row, row, row, row])

    paginator.get_next_page()
    page = paginator.get_next_page()

    assert len(page.rows) == 4
Ejemplo n.º 2
0
def test_next_page_works_twice():
    row = ["Paul", "12"]
    paginator = Paginator(header=[], rows=[row, row, row, row, row,
                                           row, row, row, row, row,
                                           row, row, row, row, row,
                                           row, row, row, row])

    paginator.get_next_page()
    page = paginator.get_next_page()

    assert len(page.rows) == 5
Ejemplo n.º 3
0
def test_next_page_contains_four_entries():
    row = ["Paul", "12"]
    paginator = Paginator(header=[], rows=[row, row, row, row, row,
                                           row, row, row, row])

    page = paginator.get_next_page()

    assert len(page.rows) == 4
Ejemplo n.º 4
0
def test_index_of_next_page():
    row = ["Paul", "12"]
    paginator = Paginator(header=[], rows=[row, row, row, row, row,
                                           row, row, row, row, row])

    page = paginator.get_next_page()

    assert len(page.rows) == 5
    assert page.rows[0][0] == 6