def test_repository_can_add_movie(session_factory): repo = SqlAlchemyRepository(session_factory) movie = Movie('Guardians of the Galaxy', 2014) movie.runtime_minutes = 121 movie.actors = [ Actor('Chris Pratt'), Actor('Vin Diesel'), Actor('Bradley Cooper'), Actor('Zoe Saldana') ] movie.genres = [Genre('Action'), Genre('Adventure'), Genre('Sci-Fi')] movie.description = "A group of intergalactic criminals are forced to work together to stop a fanatical warrior from taking control of the universe." movie.director = [Director('James Gunn')] movie.rating = 8.1 movie.meta = 76 movie.revenue = 333.13 movie.vote = 757074 repo.add_movie(1, 'Guardians of the Galaxy', 2014, movie.description, 'James Gunn', 'Chris Pratt, Vin Diesel, Bradley Cooper, Zoe Saldana', 'Action,Adventure,Sci-Fi', movie.runtime_minutes, movie.rating, movie.revenue, movie.meta, movie.vote) assert repo.get_movie("Guardians of the Galaxy") == movie
def movie(): movie = Movie('Guardians of the Galaxy', 2014) movie.runtime_minutes = 121 movie.actors = [ Actor('Chris Pratt'), Actor('Vin Diesel'), Actor('Bradley Cooper'), Actor('Zoe Saldana') ] movie.genres = [Genre('Action'), Genre('Adventure'), Genre('Sci-Fi')] movie.description = "A group of intergalactic criminals are forced to work together to stop a fanatical warrior from taking control of the universe." movie.director = Director('James Gunn') movie.rating = 8.1 movie.meta = 76 movie.revenue = 333.13 movie.vote = 757074 return movie