def test_repository_can_add_a_review(session_factory): repo = SqlAlchemyRepository(session_factory) user = User('thorke', '902fjsdf') movie = repo.get_movie(2) review = add_review("Highly recommended!", user, movie, 0) repo.add_review(review) assert review in repo.get_reviews()
def test_repository_can_retrieve_reviews(session_factory): repo = SqlAlchemyRepository(session_factory) assert len(repo.get_reviews()) == 2