def test_create_and_get_item(app):
    text = 'Yoooloooo'
    item = TodoItem(text=text)
    item.save()
    item_fetched = TodoItem.select().where(
        TodoItem.id==item.id
    ).get()

    assert item.id is not None
    assert item.id == item_fetched.id
Пример #2
0
 def render_todo(self):
     items = TodoItem.select()
     return render_template('todo.html', items=items)
Пример #3
0
def test_do_not_drop_other_chat_items_after_start(action, factory):
    factory.item()

    action.do()

    assert TodoItem.select().count() == 1
Пример #4
0
def test_drop_items_after_start(action, factory, chat):
    factory.item(chat=chat)

    action.do()

    assert TodoItem.select().count() == 0