コード例 #1
0
def test_repository_can_add_a_genre(session_factory):
    repo = SqlAlchemyRepository(session_factory)
    genre = Genre('Some New Genre')
    repo.add_genre(genre)
    assert repo.get_genre('Some New Genre') == genre and repo.get_genre('Some New Genre') is genre
コード例 #2
0
def test_repository_can_retrieve_a_genre(session_factory):
    repo = SqlAlchemyRepository(session_factory)
    genre = repo.get_genre('Sci-Fi')
    assert genre == Genre('Sci-Fi')
    assert Movie("Guardians of the Galaxy", 2014) in genre.classified_movies