Commit aeb6018b authored by Ivan Tyagov's avatar Ivan Tyagov

Add tests for isWebMode & isEditableMode.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39739 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 968c420f
......@@ -1288,6 +1288,32 @@ Hé Hé Hé!""", page.asText().strip())
relative_url=website.getRelativeUrl(),
title=website.getTitle())))
def test_19_WebModeAndEditableMode(self):
"""
Check if isWebMode & isEditableMode API works.
"""
portal = self.getPortal()
request = self.app.REQUEST
website = self.setupWebSite()
# web mode
self.assertEquals(False, self.portal.person_module.isWebMode())
self.assertEquals(True, website.isWebMode())
self.assertEquals(True, getattr(website, 'person_module').isWebMode())
# editable mode
self.assertEquals(False, self.portal.person_module.isEditableMode())
self.assertEquals(False, website.isEditableMode())
self.assertEquals(False, getattr(website, 'person_module').isEditableMode())
request.set('editable_mode', 1)
self.assertEquals(1, self.portal.person_module.isEditableMode())
self.assertEquals(1, website.isEditableMode())
self.assertEquals(1, getattr(website, 'person_module').isEditableMode())
class TestERP5WebWithSimpleSecurity(ERP5TypeTestCase):
"""
Test for erp5_web with simple security.
......
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