From aeb6018baa89b7c3f569062bcc27639e8fce2804 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Mon, 1 Nov 2010 08:32:58 +0000 Subject: [PATCH] Add tests for isWebMode & isEditableMode. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39739 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testERP5Web.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/product/ERP5/tests/testERP5Web.py b/product/ERP5/tests/testERP5Web.py index 42572f8ffd..4233d59694 100644 --- a/product/ERP5/tests/testERP5Web.py +++ b/product/ERP5/tests/testERP5Web.py @@ -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. -- 2.30.9