Пример #1
0
 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")
Пример #2
0
 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")
Пример #3
0
def get(context, request, uid=None):
    """ get todos
    """
    items = get_items("plone.todos.todo", request, uid=uid, endpoint="todos")
    return {
        "url": url_for("todos"),
        "count": len(items),
        "items": items,
    }
Пример #4
0
def get(context, request, uid=None):
    """ get story
    """
    items = get_items("sinarngo.story.story", request, uid=uid, endpoint="story")
    return {
        "url": url_for("story"),
        "count": len(items),
        "items": items,
    }
Пример #5
0
def get(context, request, uid=None):
    """ get wccdocument
    """
    items = get_items("wcc.document.document", request, uid=uid, endpoint="wccdocument")
    return {
        "url": url_for("wccdocument"),
        "count": len(items),
        "items": items,
    }
Пример #6
0
def get(context, request, uid=None):
    """ get files
    """
    items = get_items("File", request, uid=uid, endpoint="files")
    return {
        "url": url_for("files"),
        "count": len(items),
        "items": items,
    }
def get(context, request, uid=None):
    """ get collections
    """
    items = get_items("Collection", request, uid=uid, endpoint="collections")
    return {
        "url": url_for("collections"),
        "count": len(items),
        "items": items,
    }
def get(context, request, uid=None):
    """ get events
    """
    items = get_items("Event", request, uid=uid, endpoint="events")
    return {
        "url": url_for("events"),
        "count": len(items),
        "items": items,
    }
Пример #9
0
def get(context, request, uid=None):
    """ get topics
    """
    items = get_items("Topic", request, uid=uid, endpoint="topics")
    return {
        "url": url_for("topics"),
        "count": len(items),
        "items": items,
    }
Пример #10
0
def get(context, request, uid=None):
    """ get links
    """
    items = get_items("Link", request, uid=uid, endpoint="links")
    return {
        "url": url_for("links"),
        "count": len(items),
        "items": items,
    }
Пример #11
0
 def test_delete_items(self):
     api.delete_items("Folder", uid=self.test_folder.UID())
     self.assertEqual(len(api.get_items("Folder")), 0)
Пример #12
0
 def test_get_items(self):
     results = api.get_items("Folder")
     self.assertEqual(len(results), 1)
Пример #13
0
 def test_get_items(self):
     results = api.get_items("Folder")
     self.assertEqual(len(results), 1)
Пример #14
0
 def test_delete_items(self):
     api.delete_items("Folder", uid=self.test_folder.UID())
     self.assertEqual(len(api.get_items("Folder")), 0)
Пример #15
0
def get(context, request, uid=None):
    """ get newsitems
    """
    items = get_items("News Item", request, uid=uid, endpoint="newsitems")
    return {"url": url_for("newsitems"), "count": len(items), "items": items}