def test_repository_returns_date_of_previous_article(session_factory): repo = SqlAlchemyRepository(session_factory) article = repo.get_article(6) previous_date = repo.get_date_of_previous_article(article) assert previous_date.isoformat() == '2020-03-01'
def test_repository_returns_none_when_there_are_no_previous_articles( session_factory): repo = SqlAlchemyRepository(session_factory) article = repo.get_article(1) previous_date = repo.get_date_of_previous_article(article) assert previous_date is None