Commit 7ad35289 authored by Gabriel Monnerat's avatar Gabriel Monnerat

- refactor test

- use id instead of uid to validate if the objects were deleted correctly

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45613 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent befaac54
......@@ -148,7 +148,8 @@ 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")
web_page_module = self.portal.web_page_module
web_page = web_page_module.newContent(portal_type="Web Page")
relative_url = web_page.getRelativeUrl()
self.portal.REQUEST.set("uids", [web_page.getUid(),])
self.stepTic()
......@@ -160,9 +161,9 @@ class TestUNG(ERP5TypeTestCase):
self.portal.WebSection_deleteObjectList()
self.stepTic()
self.assertEquals(len(self.portal.portal_catalog(relative_url=relative_url)), 0)
web_page = self.portal.web_page_module.newContent(portal_type="Web Page")
web_table = self.portal.web_page_module.newContent(portal_type="Web Table")
web_illustration = self.portal.web_page_module.newContent(portal_type="Web Illustration")
web_page = web_page_module.newContent(portal_type="Web Page")
web_table = web_page_module.newContent(portal_type="Web Table")
web_illustration = web_page_module.newContent(portal_type="Web Illustration")
web_page.publish()
web_table.publish()
web_illustration.publish()
......@@ -177,11 +178,14 @@ class TestUNG(ERP5TypeTestCase):
self.assertEquals(web_table.getValidationState(), "deleted")
self.assertEquals(web_illustration.getValidationState(), "deleted")
self.portal.REQUEST.set("uids", uid_list)
id_list = [web_page.getId(),
web_table.getId(),
web_illustration.getId()]
self.portal.web_site_module.ung.WebSection_deleteObjectList()
self.stepTic()
self.assertFalse(uid_list[0] in self.portal.web_page_module.objectIds())
self.assertFalse(uid_list[1] in self.portal.web_page_module.objectIds())
self.assertFalse(uid_list[2] in self.portal.web_page_module.objectIds())
self.assertFalse(id_list[0] in web_page_module.objectIds())
self.assertFalse(id_list[1] in web_page_module.objectIds())
self.assertFalse(id_list[2] in web_page_module.objectIds())
def testERP5Site_userFollowUpWebPage(self):
"""Test if user is added in field Follow Up of Web Page"""
......
364
\ No newline at end of file
365
\ 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