Пример #1
0
def test_delete_not_existing_todo(repository: Repository) -> None:
    id_, text = _insert_todo(repository, "This is a Todo!")

    result = repository.delete(_random_id())
    assert not result

    todo = repository.get(id_)
    assert todo == Todo(id=id_, text=text, active=True)
Пример #2
0
def test_delete_existing_todo(repository: Repository) -> None:
    id_1, _ = _insert_todo(repository, "This is a Todo!")
    id_2, text_2 = _insert_todo(repository, "This is a ANOTHER Todo!")

    result = repository.delete(id_1)
    assert result

    todos = repository.list()
    assert todos == (Todo(id=id_2, text=text_2, active=True), )