def test_mark_incomplete_not_existing_todo(repository: Repository) -> None: id_, text = _insert_todo(repository, "This is a Todo!") result = repository.activate(_random_id()) assert not result todo = repository.get(id_) assert todo == Todo(id=id_, text=text, active=True)
def test_mark_incomplete_existing_todo(repository: Repository) -> None: id_1, text_1 = _insert_todo(repository, "This is a Todo!") id_2, text_2 = _insert_todo(repository, "This is a ANOTHER Todo!") repository.deactivate(id_2) result = repository.activate(id_2) assert result todos = repository.list() assert todos == tuple( sorted((Todo(id=id_1, text=text_1, active=True), Todo(id=id_2, text=text_2, active=True))))