Commit 45e8dc48 authored by Gabriel Monnerat's avatar Gabriel Monnerat

continuation of r43867. Add test

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43868 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7f3a26f
......@@ -64,9 +64,28 @@ class TestUNGSecurity(ERP5TypeTestCase):
'erp5_web_ung_theme',
'erp5_web_ung_role')
def testERP5Site_createNewWebDocumentAsAnnonymous(self):
""" """
def testERP5Site_createNewWebDocumentAsAnonymous(self):
"""Test use script ERP5Site_createNewWebDocument as Anonymous User"""
self.logout()
self.assertRaises(Unauthorized,
self.portal.ERP5Site_createNewWebDocument,
("web_page_template"))
def testERP5Site_createNewWebDocumentWithUNGRole(self):
"""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)
web_page = self.portal.ERP5Site_createNewWebDocument("web_page_template")
self.stepTic()
web_page = self.portal.portal_catalog.getResultValue(portal_type="Web Page")
self.assertEquals(web_page.getReference(), "default-Web.Page.Reference")
self.assertEquals(len(self.portal.web_page_module.searchFolder()), 1)
\ No newline at end of file
11
\ No newline at end of file
12
\ 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