Commit a4bc0cfe authored by Gabriel Monnerat's avatar Gabriel Monnerat

- add asserts

- clean up the code in script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5db7cb93
......@@ -50,10 +50,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal_type_list = ["Web Page", "Web Table", "Web Illustration"]\n
<value> <string>portal_type_list = ["Web Page", "Web Table", "Web Illustration", "Email Thread"]\n
\n
portal = context.getPortalObject()\n
website_url = context.absolute_url()\n
uid_list = context.REQUEST.get("uids")\n
\n
if uid_list is not None:\n
......@@ -61,8 +60,8 @@ if uid_list is not None:\n
uid=uid_list):\n
object = context.restrictedTraverse(catalog_object.getPath())\n
if object.getValidationState() == "deleted":\n
portal.web_page_module.deleteContent(object.getId())\n
continue\n
parent_folder = object.getParent()\n
parent_folder.deleteContent(object.getId())\n
else:\n
object.delete()\n
\n
......
......@@ -133,8 +133,14 @@ class TestUNG(ERP5TypeTestCase):
def testWebSection_deleteObjectList(self):
"""Test if objects are deleted correctly"""
web_page = self.portal.web_page_module.newContent(portal_type="Web Page")
relative_url = web_page.getRelativeUrl()
self.portal.REQUEST.set("uids", [web_page.getUid(),])
self.stepTic()
self.portal.WebSection_deleteObjectList()
self.stepTic()
self.assertEquals(web_page.getValidationState(), "deleted")
self.portal.REQUEST.set("uids", [web_page.getUid(),])
self.stepTic()
self.portal.WebSection_deleteObjectList()
self.stepTic()
self.assertEquals(len(self.portal.portal_catalog(relative_url=relative_url)), 0)
253
\ No newline at end of file
254
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment