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'
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"