Ticket Paging: 1 failed, 2 passed

I don’t understand why the second test fail.

tests/test_paging.py .F. [100%]

========================================================================= FAILURES =========================================================================
______________________________________________________________ test_supports_paging_by_genre _______________________________________________________________

client = <FlaskClient <Flask ‘mflix.factory’>>

@pytest.mark.paging
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

E assert 45993 == 1503

If the page is 0 the results should be total_num_movies = db.movies.count_documents(query).
Why fails?

If you query on dataset using filter: “{'genres': 'History' }”. There are 1503 documents.
Your implementation should also apply filter with paging. You must have completed this step in “Ticket: Text and Subfield Search”

I hope it helps.

Kanika

Yes, you are ready. Thank you.