def test_repository_can_add_a_comment(session_factory):
    repo = SqlAlchemyRepository(session_factory)

    user = repo.get_user('thorke')
    article = repo.get_article(2)
    comment = make_comment("Trump's onto it!", user, article)

    repo.add_comment(comment)

    assert comment in repo.get_comments()
def test_repository_can_retrieve_comments(session_factory):
    repo = SqlAlchemyRepository(session_factory)

    assert len(repo.get_comments()) == 3