def test_repository_can_retrieve_movie_count(session_factory): repo = SqlAlchemyRepository(session_factory) number_of_movies = repo.get_number_of_movies() # Check that the query returned 1000 Movie. assert number_of_movies == 1000
def test_repository_can_add_movie(session_factory): repo = SqlAlchemyRepository(session_factory) number_of_movies = repo.get_number_of_movies() new_movie_id = number_of_movies + 1 movie = Movie('Parasite', 2019, new_movie_id) repo.add_movie(movie) assert repo.get_movie(new_movie_id) == movie