Paging ticket cannot be solved

As shown, the actual count of history movies is only 15, but the test is looking for 1503. No way my code can pass the test.

def test_supports_paging_by_genre(client):
    filter = {'genres': ['History']}
    (movies0, results0) = get_movies(filter, 0, 20)
    assert len(list(movies0)) == 20
    assert results0 == 1503
    last_page = int(1503 / 20)
    (movies2, results2) = get_movies(filter, last_page, 20)
  assert len(list(movies2)) == results0 % 20

E AssertionError: assert 23 == (1503 % 20)

The answer to paging as a hint lies within the get_movies_faceted section of the

1 Like

I have no idea what to do with this one… any hints @jscott-CT ?

Hi @Lee_12536

Is this still a problem for you ? Did you check out @jscott-CT hint ?

Kindest regards,

skip_stage = {"$skip": movies_per_page * page}

This should be incorporated into the paging function, the code is mostly there and this shouldn’t take more than updating the code a little bit in the function.