Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py =================================================================== --- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py (revision 3607) +++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py (revision 3608) @@ -223,5 +223,6 @@ self.moveAction(id, cat_name, steps=1) IStatusMessage(self.request).addStatusMessage( - _(u"'${id}' action moved up.", mapping={'id': id}), type="info") + _(u"'${id}' action moved up.", mapping={'id': id}), + type="info") self.redirect(search="category=%s" % cat_name) return False @@ -687,5 +688,6 @@ self.kss_toggleCollapsible( ksscore.getCssSelector('form[name=addaction_form] ' - '.headerAdvanced'), collapse='false') + '.headerAdvanced'), + collapse='false') message = _(u"Please correct the indicated errors.") Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py =================================================================== --- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py (revision 3607) +++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py (revision 3608) @@ -11,5 +11,5 @@ from quintagroup.plonetabs.browser.interfaces import IPloneTabsControlPanel from quintagroup.plonetabs.browser.plonetabs \ - import PloneTabsControlPanel as ptp + import PloneTabsControlPanel as ptp from quintagroup.plonetabs.tests.base import PloneTabsTestCase from quintagroup.plonetabs.tests.data import PORTAL_ACTIONS @@ -22,5 +22,5 @@ self.loginAsPortalOwner() panel = getMultiAdapter((self.portal, self.portal.REQUEST), - name='plonetabs-controlpanel') + name='plonetabs-controlpanel') # we need this to apply zope2 security (got from zope2 traverse method) self.panel = panel.__of__(self.portal) @@ -31,15 +31,15 @@ method = self.panel.redirect portal_url = getMultiAdapter((self.portal, self.portal.REQUEST), - name=u"plone_portal_state").portal_url() + name=u"plone_portal_state").portal_url() url = '%s/@@plonetabs-controlpanel' % portal_url method() self.assertEquals(response.headers.get('location', ''), url, - 'Redirect method is not working properly.') + 'Redirect method is not working properly.') # check query string and anchor hash method('http://quintagroup.com', 'q=test', 'hash_code') self.assertEquals(response.headers.get('location', ''), - 'http://quintagroup.com?q=test#hash_code', - 'Redirect method is not working properly.') + 'http://quintagroup.com?q=test#hash_code', + 'Redirect method is not working properly.') def test_fixExpression(self): @@ -47,5 +47,5 @@ self.assertEquals(method('/slash'), 'string:${portal_url}/slash') self.assertEquals(method('https://test.com'), - 'string:https://test.com') + 'string:https://test.com') self.assertEquals(method('python:True'), 'python:True') self.assertEquals(method('hello'), 'string:${object_url}/hello') @@ -64,5 +64,5 @@ errors = method('new_category', good_data) self.assertEquals(errors, {}, - 'There should be no errors for valid data.') + 'There should be no errors for valid data.') bad_data = {'id': '', @@ -88,5 +88,6 @@ self.assertEquals(len(errors.keys()), 4, - 'validateActionFields method is not working properly.') + 'validateActionFields method is not working ' + 'properly.') #### pyflakes.scripts.pyflakes ends. @@ -95,8 +96,8 @@ errors = {'error': 'error message'} self.assertEquals(method(errors), errors, - 'processErrors method is not working properly.') + 'processErrors method is not working properly.') self.assertEquals(method(errors, 'pre_', '_post'), - {'pre_error_post': 'error message'}, - 'processErrors method is not working properly.') + {'pre_error_post': 'error message'}, + 'processErrors method is not working properly.') def test_parseEditForm(self): @@ -110,10 +111,10 @@ 'available_expr_id1': 'expr2'} self.assertEquals(method(form), - ('id1', 'cat1', {'id': 'id_new', - 'title': 'title1', - 'url_expr': 'expr1', - 'available_expr': 'expr2', - 'visible': True}), - 'parseEditForm method is not working properly.') + ('id1', 'cat1', {'id': 'id_new', + 'title': 'title1', + 'url_expr': 'expr1', + 'available_expr': 'expr2', + 'visible': True}), + 'parseEditForm method is not working properly.') del form['orig_id'] @@ -129,10 +130,10 @@ 'available_expr': 'expr2'} self.assertEquals(method(form), - ('id1', 'cat1', {'id': 'id1', - 'visible': True, - 'title': 'title1', - 'url_expr': 'string:expr1', - 'available_expr': 'expr2'}), - 'parseAddForm method is not working properly.') + ('id1', 'cat1', {'id': 'id1', + 'visible': True, + 'title': 'title1', + 'url_expr': 'string:expr1', + 'available_expr': 'expr2'}), + 'parseAddForm method is not working properly.') del form['id'] @@ -146,5 +147,5 @@ self.setupActions(self.tool) self.assertEquals(method('portal_tabs').id, 'portal_tabs', - 'getActionCategory is not working properly.') + 'getActionCategory is not working properly.') def test_getOrCreateCategory(self): @@ -152,5 +153,5 @@ self.purgeActions() self.assertEquals(method('portal_tabs').id, 'portal_tabs', - 'getOrCreateCategory is not working properly.') + 'getOrCreateCategory is not working properly.') def test_setSiteProperties(self): @@ -158,5 +159,5 @@ sp = getToolByName(self.portal, 'portal_properties').site_properties self.assertEquals(sp.getProperty('title'), 'Test Title', - 'setSiteProperties method is not working properly.') + 'setSiteProperties method is not working properly.') def test_renderViewlet(self): @@ -195,5 +196,5 @@ self.panel.addAction('new_category', {'id': 'id1', 'title': 'Test'}) self.failUnless('id1' in self.tool.new_category.objectIds(), - 'addAction method is not workig properly') + 'addAction method is not workig properly') def test_updateAction(self): @@ -210,5 +211,5 @@ method('home', 'portal_tabs', {'id': 'new_home'}) self.failUnless('new_home' in self.tool.portal_tabs.objectIds(), - 'updateAction method is not workig properly') + 'updateAction method is not workig properly') def test_deleteAction(self): @@ -217,5 +218,5 @@ self.panel.deleteAction('home', 'portal_tabs') self.failIf('home' in self.tool.portal_tabs.objectIds(), - 'deleteAction method is not workig properly') + 'deleteAction method is not workig properly') def test_moveAction(self): @@ -224,8 +225,8 @@ pos = self.tool.portal_tabs.getObjectPosition self.assertEquals(pos('home'), 0, - 'moveAction method is not workig properly') + 'moveAction method is not workig properly') self.panel.moveAction('home', 'portal_tabs', -1) self.assertEquals(pos('home'), 1, - 'moveAction method is not workig properly') + 'moveAction method is not workig properly') @@ -237,5 +238,5 @@ self.loginAsPortalOwner() panel = getMultiAdapter((self.portal, self.portal.REQUEST), - name='plonetabs-controlpanel') + name='plonetabs-controlpanel') # we need this to apply zope2 security (got from zope2 traverse method) self.panel = panel.__of__(self.portal) @@ -244,16 +245,18 @@ def test_interface(self): self.failUnless(IPloneTabsControlPanel.implementedBy(ptp), - 'PloneTabs control panel does not implement required interface.') + 'PloneTabs control panel does not implement ' + 'required interface.') self.failUnless(verifyClass(IPloneTabsControlPanel, ptp), - 'PloneTabs control panel does not implement required interface.') + 'PloneTabs control panel does not implement ' + 'required interface.') def test_getPageTitle(self): self.assertEquals(self.panel.getPageTitle(), - _(u"Portal Tabs Configuration"), - 'getPageTitle method is broken') + _(u"Portal Tabs Configuration"), + 'getPageTitle method is broken') self.assertEquals(self.panel.getPageTitle(category='notexists'), - _(u"Plone '${cat_name}' Configuration", - mapping={'cat_name': 'notexists'}), - 'getPageTitle method is broken') + _(u"Plone '${cat_name}' Configuration", + mapping={'cat_name': 'notexists'}), + 'getPageTitle method is broken') def test_hasActions(self): @@ -262,10 +265,10 @@ self.purgeActions() self.failIf(method(), - 'There should be no portal_tab actions in portal') + 'There should be no portal_tab actions in portal') # setup our own actions self.setupActions(self.tool) self.failUnless(method(), - 'There should be portal_tab actions in portal') + 'There should be portal_tab actions in portal') def test_getPortalActions(self): @@ -273,15 +276,16 @@ # purge any default portal actions self.purgeActions() - self.assertEquals(len(method()), 0, - 'There should be no actions in portal_tabs category.') + self.assertEquals(len(method()), 0, 'There should be no actions in ' + 'portal_tabs category.') # setup our own actions self.setupActions(self.tool) self.assertEquals(len(method()), 2, - 'There should be 2 actions in portal_tabs category.') + 'There should be 2 actions in portal_tabs category.') # marginal arguments self.assertEquals(len(method('notexistent_category')), 0, - 'There should be no actions for not existed category.') + 'There should be no actions for not existed ' + 'category.') def test_isGeneratedTabs(self): @@ -304,17 +308,17 @@ self.purgeActions() self.failIf('class="editform"' in method(), - 'There should no be actions in actions list template.') + 'There should no be actions in actions list template.') self.setupActions(self.tool) self.failUnless('class="editform"' in method(), - 'There are no actions in actions list template.') + 'There are no actions in actions list template.') def test_getAutoGenereatedSection(self): method = self.panel.getAutoGenereatedSection self.failIf('