def test_collection_view_append(notion_token): notion_api = NotionApi(token=notion_token) collection_view = create_collection_view() collection_id = collection_view.parent.id.replace("-", "") view_id = collection_view.id.replace("-", "") notion_api.collection_append(collection_id, view_id, { "enabled": True, "value": 10, "name": "test row" }) collection_view_content = notion_api.collection_view_content( collection_id, view_id) assert collection_view_content[0]["name"] == "test row" assert collection_view_content[0]["enabled"] is True assert collection_view_content[0]["value"] == 10
def collection_append(notion_token, collection_id, view_id): try: notion_api = NotionApi(notion_token) row = notion_api.collection_append(collection_id, view_id, request.json) return jsonify(row=row), 200 except Exception as error: return jsonify(error=str(error)), 500