def test_block_content(notion_token): notion_api = NotionApi(token=notion_token) test_page = get_test_page() block = test_page.children.add_new(TextBlock, title="test get block content") content = notion_api.block_content(block.id) assert content == {"id": block.id, "title": "test get block content"}
def block_view(notion_token, block_id): try: notion_api = NotionApi(notion_token) content = notion_api.block_content(block_id) return jsonify(content=content), 200 except Exception as error: return jsonify(error=str(error)), 500