def test_create_items(self): # create a folder inside the testfolder data = {"title": "Subfolder"} self.request["BODY"] = json.dumps(data) api.create_items("Folder", uid=self.test_folder.UID()) results = api.get_items("Folder") self.assertEqual(len(results), 2) self.assertEqual(self.test_folder.subfolder.Title(), "Subfolder")
def create(context, request, uid=None): """ create events """ items = create_items("Event", uid=uid, endpoint="events") return { "url": url_for("events_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create story """ items = create_items("sinarngo.story.story", request, uid=uid, endpoint="story") return { "url": url_for("story_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create wccdocument """ items = create_items("wcc.document.document", request, uid=uid, endpoint="wccdocument") return { "url": url_for("wccdocument_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create links """ items = create_items("Link", uid=uid, endpoint="links") return { "url": url_for("links_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create topics """ items = create_items("Topic", uid=uid, endpoint="topics") return { "url": url_for("topics_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create content """ items = create_items(uid=uid) return { "url": url_for("create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create images """ items = create_items("Image", uid=uid, endpoint="images") return { "url": url_for("images_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create folders """ items = create_items("Folder", uid=uid, endpoint="folders") return { "url": url_for("folders_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create collections """ items = create_items("Collection", uid=uid, endpoint="collections") return { "url": url_for("collections_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create folders """ items = create_items("Folder", request, uid=uid, endpoint="folders") return { "url": url_for("folders_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create newsitems """ items = create_items("News Item", uid=uid, endpoint="newsitems") return { "url": url_for("newsitems_create"), "count": len(items), "items": items, }
def create(context, request, uid=None): """ create todos """ items = create_items("plone.todos.todo", request, uid=uid, endpoint="todos") return { "url": url_for("todos_create"), "count": len(items), "items": items, }