Python driver and neo4j - tests/02_movie_list__test.py

Hi, i am trying to run the example of movie list

pytest -s tests/02_movie_list__test.py

but it keep gives me error. i just basically clone the code from git hub and tried to simply run it.

FAILED tests/02_movie_list__test.py::test_pagination - assert 6 is 1
FAILED tests/02_movie_list__test.py::test_ordering - assert 6 is 1

I dont quite understand the error. also after running this code, how do i check if the database has get updated? and which database I am using? can i have the username, password and the link so i can test before and after executing this 02_movie_list__test.py ?

thanks so much!!

Hi,

Have you been through the course and completed the activities to add the code to the project? This is the result I get if I just run the test without adding the code.

The repo contains the starter code, not the complete project.

The database (a neo4j sandbox) you are using is created when you start the course, you can see the connection details in the first lesson - https://graphacademy.neo4j.com/courses/app-python/0-setup/1-setup/

You can access the sandbox by clicking the sandbox button in the bottom right of the lesson.

Martin

hi martin,

thanks for your advise. i just added the code as described from the lesson on def all in api/dao/movies.py, and re run the code again, and got session error.

FAILED tests/02_movie_list__test.py::test_pagination - AttributeError: 'NoneType' object has no attribute 'session'
FAILED tests/02_movie_list__test.py::test_ordering - AttributeError: 'NoneType' object has no attribute 'session'

i am wondering where do i put the userid and password information in the python code so i can assess the session? and do i put the Sandbox Credentials as described at the lesson on Exploring the Project (userid: neo4j, password: alley-fund-hairpin, url: bolt://44.222.71.201:7687) to begin the session in python?

thanks!!