Commit 314352df authored by Gabriel Monnerat's avatar Gabriel Monnerat

remove code duplicated

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44158 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7bc2a328
......@@ -68,11 +68,18 @@ class TestUNGSecurity(ERP5TypeTestCase):
'erp5_web_ung_role')
def beforeTearDown(self):
""" """
person_module = self.getPersonModule()
person_module.manage_delObjects(list(person_module.objectIds()))
self.stepTic()
def afterSetUp(self):
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
self.stepTic()
def testERP5Site_createNewWebDocumentAsAnonymous(self):
"""Test use script ERP5Site_createNewWebDocument as Anonymous User"""
self.logout()
......@@ -84,12 +91,6 @@ class TestUNGSecurity(ERP5TypeTestCase):
"""Test use script ERP5Site_createNewWebDocument when a erp5 user have role
to create and edit document in UNG"""
self.portal.portal_preferences.ung_preference.enable()
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
self.stepTic()
self.login("ung_user")
web_page = self.portal.portal_catalog.getResultValue(portal_type="Web Page")
self.assertEquals(web_page, None)
......@@ -101,11 +102,6 @@ class TestUNGSecurity(ERP5TypeTestCase):
def testShareDocument(self):
"""Test the document sharing between erp5 users"""
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user2",
first_name="Gabriel")
......@@ -129,12 +125,6 @@ class TestUNGSecurity(ERP5TypeTestCase):
def testBase_updateCalendarEventListWithERP5User(self):
""" Test script Base_updateCalendarEventList with erp5 user"""
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
self.stepTic()
self.logout()
self.assertEquals('{"events": []}',
self.portal.Base_updateCalendarEventList("list"))
......
19
\ No newline at end of file
20
\ 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