예제 #1
0
def test_delete_item():
    ItemFactory()
    item = ItemFactory()
    assert len(items.list()) == 2

    items.delete(item.id)

    assert len(items.list()) == 1
예제 #2
0
def test_bulk_delete():
    ItemFactory()
    ids = [ItemFactory().id for i in range(10)]
    assert len(items.list()) == 11

    items.bulk_delete(ids)

    assert len(items.list()) == 1
예제 #3
0
def test_update_item_updates_item():
    data = {'body': "Text"}
    response = items.create(data)
    id = response['id']

    data['body'] = "Updated text"
    response = items.update(id, data)

    # TODO: Update to use items.get() when ready
    assert len(items.list(body="Text")) == 0

    [updated_item] = items.list(body="Updated text")

    assert updated_item['id'] == id