コード例 #1
0
async def test_contentapi_create(db, guillotina_main):
    async with ContentAPI(guillotina_main.root['db']) as api:
        container = await api.create({'@type': 'Container', 'id': 'foobar'})
        await api.use_container(container)
        await api.create({'@type': 'Item', 'id': 'foobar'}, in_=container)
        item = await api.get('foobar', in_=container)
        assert get_content_path(item) == '/foobar'
コード例 #2
0
ファイル: test_contentapi.py プロジェクト: sunbit/guillotina
async def test_contentapi_create(db, guillotina_main):
    async with ContentAPI(guillotina_main.root["db"]) as api:
        container = await api.create({"@type": "Container", "id": "foobar"})
        await api.use_container(container)
        await api.create({"@type": "Item", "id": "foobar"}, in_=container)
        item = await api.get("foobar", in_=container)
        assert get_content_path(item) == "/foobar"