Ticket: Text and Subfield Search, incorrect pytest failure

Hi all, I have completed the Ticket: Test and Subfield Search, however I get some weird errors on the tests:

def test_genre_search(client):
    filter = {'genres': ['Action']}
    (movies, results) = get_movies(filter, 0, 20)
    assert len(list(movies)) == 20
>       assert results == 5917
E       assert 46014 == 5917

It looks to me like the error is not correct - the assert results is 5917 and my query returns 5917, I have tested in the mongoshell and I also return a movies.count_documents({query}) with 5917 - so I am not sure why this is failing the test.

Also I get an error in the python run.py file for this one which reads " Text and Subfield Search: Did not receive the proper response when searching by genre".

Not sure why this is failing the test when seemingly it is actually passing - anyone else had this issue??

Please refer the hint -
Check the implementation of similar formats of search criteria - the genres query should similar.
Refer the text and cast implementations to come up with implementation of genres.

Hope it works.

Thank you Sampreet. This is exactly what I did, I used the cast query as a model.