Commit 715b0b72 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Add new test

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44215 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 90e65960
...@@ -21,17 +21,19 @@ ...@@ -21,17 +21,19 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
############################################################################## ##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zExceptions import Unauthorized from zExceptions import Unauthorized
from DateTime import DateTime from DateTime import DateTime
import json import json
class TestUNGSecurity(ERP5TypeTestCase): class TestUNGSecurity(ERP5TypeTestCase):
"""""" """Test Suite to validate all cases of permissions in UNG"""
def getTitle(self): def getTitle(self):
return "Test UNG Security" return "Test UNG Security"
...@@ -66,7 +68,7 @@ class TestUNGSecurity(ERP5TypeTestCase): ...@@ -66,7 +68,7 @@ class TestUNGSecurity(ERP5TypeTestCase):
'erp5_web_ung_core', 'erp5_web_ung_core',
'erp5_web_ung_theme', 'erp5_web_ung_theme',
'erp5_web_ung_role') 'erp5_web_ung_role')
def beforeTearDown(self): def beforeTearDown(self):
person_module = self.getPersonModule() person_module = self.getPersonModule()
person_module.manage_delObjects(list(person_module.objectIds())) person_module.manage_delObjects(list(person_module.objectIds()))
...@@ -178,3 +180,11 @@ class TestUNGSecurity(ERP5TypeTestCase): ...@@ -178,3 +180,11 @@ class TestUNGSecurity(ERP5TypeTestCase):
person = self.portal.portal_catalog.getResultValue(portal_type="Person") person = self.portal.portal_catalog.getResultValue(portal_type="Person")
self.assertEquals(person.getLastName(), "My Last Name") self.assertEquals(person.getLastName(), "My Last Name")
self.assertEquals(person.getValidationState(), "validated") self.assertEquals(person.getValidationState(), "validated")
def testBase_getPreferencePathList(self):
"""Test if with a normal user the paths of preference objects are returned correctly"""
self.logout()
self.assertEquals(json.loads(self.portal.Base_getPreferencePathList()), None)
self.login("ung_user")
preference_dict = json.loads(self.portal.Base_getPreferencePathList())
self.assertEquals(preference_dict["preference"], "portal_preferences/1")
22 23
\ No newline at end of file \ 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