Index: /quintagroup.plonetabs/trunk/docs/HISTORY.txt
===================================================================
--- /quintagroup.plonetabs/trunk/docs/HISTORY.txt	(revision 3436)
+++ /quintagroup.plonetabs/trunk/docs/HISTORY.txt	(revision 3437)
@@ -2,6 +2,17 @@
 =========
 
+0.7.1-dev (unreleased)
+----------------------
+* Updated code according with pep8, pylint, pyflakes
+  [potar]
+
+* Fixed tests and compatibility with Plone 3  (added plone detecting)
+  [potar]
+
+* Added plone.browserlayer to install_requires (setup.py)
+  [potar]
+
 0.7 - (12-03-2012)
--------------------
+------------------
 * Updated permissions. Starting from Plone 4.1 it is necessary
   to import permissions.zcml from Products.CMFCore.
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/Install.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/Install.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/Install.py	(revision 3437)
@@ -14,19 +14,20 @@
 )
 
+
 def install(self, reinstall=False):
     """Install a set of products (which themselves may either use Install.py
     or GenericSetup extension profiles for their configuration) and then
     install a set of extension profiles.
-    
+
     One of the extension profiles we install is that of this product. This
     works because an Install.py installation script (such as this one) takes
-    precedence over extension profiles for the same product in 
-    portal_quickinstaller. 
-    
+    precedence over extension profiles for the same product in
+    portal_quickinstaller.
+
     We do this because it is not possible to install other products during
     the execution of an extension profile (i.e. we cannot do this during
     the importVarious step for this profile).
     """
-    
+
     portal_quickinstaller = getToolByName(self, 'portal_quickinstaller')
     portal_setup = getToolByName(self, 'portal_setup')
@@ -39,15 +40,17 @@
             portal_quickinstaller.installProduct(product)
             transaction.savepoint()
-    
+
     for extension_id in EXTENSION_PROFILES:
-        portal_setup.runAllImportStepsFromProfile('profile-%s' % extension_id, purge_old=False)
+        portal_setup.runAllImportStepsFromProfile('profile-%s' % extension_id,
+                                                  purge_old=False)
         product_name = extension_id.split(':')[0]
         portal_quickinstaller.notifyInstalled(product_name)
         transaction.savepoint()
 
+
 def uninstall(self):
     portal_setup = getToolByName(self, 'portal_setup')
     for extension_id in UNINSTALL_PROFILES:
-        portal_setup.runAllImportStepsFromProfile('profile-%s' % extension_id, purge_old=False)
-        product_name = extension_id.split(':')[0]
+        portal_setup.runAllImportStepsFromProfile('profile-%s' % extension_id,
+                                                  purge_old=False)
         transaction.savepoint()
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/Extensions/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-#
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/__init__.py	(revision 3437)
@@ -3,4 +3,5 @@
 messageFactory = MessageFactory('quintagroup.plonetabs')
 
+
 def initialize(context):
     pass
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-# I'm a package
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/interfaces.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/interfaces.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/interfaces.py	(revision 3437)
@@ -1,47 +1,47 @@
 from zope.interface import Interface, Attribute
+
 
 class IPloneTabsControlPanel(Interface):
     """Configlet for managing portal_actions, quintagroup.plonetabs"""
-    
+
     prefix = Attribute('prefix', 'Prefix to apply on edit forms')
     sufix = Attribute('sufix', 'Sufix to apply on edit forms')
-    
+
     def getPageTitle(category='portal_tabs'):
         """Return Title for configlet page for given category"""
-    
+
     def hasActions(category="portal_tabs"):
         """Whether there are actions in portal_actions with given category"""
-    
+
     def getPortalActions(category="portal_tabs"):
         """Return portal actions with given category"""
-    
+
     def isGeneratedTabs():
         """Whether disable_folder_section field is turned off"""
-    
+
     def isNotFoldersGenerated():
         """Whether disable_nonfolderish_sections field is turned off"""
-    
+
     def getActionsList(category="portal_tabs"):
         """Return html code for actions list with given category"""
-    
+
     def getAutoGenereatedSection(cat_name, errors):
         """Return html code for all autogenerated section"""
-    
+
     def getGeneratedTabs():
         """Return html code for autogenerated tabs"""
-    
+
     def getRootTabs():
         """Return portal root elements"""
-    
+
     def getCategories():
         """Return list of categories contained in portal_actions tool"""
-    
+
     def portal_tabs():
         """See global-sections viewlet"""
-    
+
     def selected_portal_tab():
         """See global-sections viewlet"""
-    
+
     def test(condition, ifTrue, ifFalse):
         """Instead of test function in skins page templates"""
-    
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py	(revision 3437)
@@ -24,5 +24,5 @@
 from Products.statusmessages.interfaces import IStatusMessage
 
-from quintagroup.plonetabs.config import *
+from quintagroup.plonetabs.config import PROPERTY_SHEET, FIELD_NAME
 from quintagroup.plonetabs import messageFactory as _
 from interfaces import IPloneTabsControlPanel
@@ -39,4 +39,5 @@
 cookie_name = 'ploneTabsMode'
 
+
 class PloneTabsControlPanel(PloneKSSView):
 
@@ -60,8 +61,6 @@
         postback = True
         errors = {}
-        context = aq_inner(self.context)
 
         form = self.request.form
-        action = form.get("action", "")
         submitted = form.get('form.submitted', False)
 
@@ -148,5 +147,5 @@
             IStatusMessage(self.request).addStatusMessage(
                 _(u"'${id}' action successfully added.",
-                  mapping={'id':action.id}), type="info")
+                  mapping={'id': action.id}), type="info")
             self.redirect(search="category=%s" % cat_name)
             return False
@@ -179,5 +178,5 @@
         else:
             errs.update(self.processErrors(errors,
-                sufix='_%s' % id)) # add edit form sufix to error ids
+                sufix='_%s' % id))  # add edit form sufix to error ids
             IStatusMessage(self.request).addStatusMessage(
                 _(u"Please correct the indicated errors."), type="error")
@@ -214,5 +213,5 @@
             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
@@ -247,5 +246,5 @@
         """Redirect to @@plonetabs-controlpanel configlet"""
         if not url:
-            portal_url =  getMultiAdapter((self.context, self.request),
+            portal_url = getMultiAdapter((self.context, self.request),
                 name=u"plone_portal_state").portal_url()
             url = '%s/%s' % (portal_url, "@@plonetabs-controlpanel")
@@ -302,5 +301,5 @@
         """See interface"""
         tool = getToolByName(self.context, "portal_actions")
-        return len(tool.listActions(categories=[category,])) > 0
+        return len(tool.listActions(categories=[category, ])) > 0
 
     def getPortalActions(self, category="portal_tabs"):
@@ -322,5 +321,6 @@
         site_properties = getToolByName(self.context,
                                         "portal_properties").site_properties
-        return not site_properties.getProperty("disable_folder_sections", False)
+        return not site_properties.getProperty("disable_folder_sections",
+                                               False)
 
     def isNotFoldersGenerated(self):
@@ -364,5 +364,5 @@
         query = {}
         rootPath = getNavigationRoot(context)
-        query['path'] = {'query' : rootPath, 'depth' : 1}
+        query['path'] = {'query': rootPath, 'depth': 1}
         query['portal_type'] = utils.typesToList(context)
 
@@ -388,5 +388,5 @@
         excludedIds = {}
         for id in idsNotToList:
-            excludedIds[id]=1
+            excludedIds[id] = 1
 
         rawresult = portal_catalog.searchResults(**query)
@@ -396,9 +396,9 @@
             if not excludedIds.has_key(item.getId):
                 id, item_url = get_view_url(item)
-                data = {'name'       : utils.pretty_title_or_id(context, item),
-                        'id'         : id,
-                        'url'        : item_url,
+                data = {'name': utils.pretty_title_or_id(context, item),
+                        'id': id,
+                        'url': item_url,
                         'description': item.Description,
-                        'exclude_from_nav' : item.exclude_from_nav}
+                        'exclude_from_nav': item.exclude_from_nav}
                 result.append(data)
 
@@ -426,12 +426,18 @@
     def portal_tabs(self):
         """See global-sections viewlet"""
-        actions = context_state = getMultiAdapter((self.context, self.request),
-            name=u"plone_context_state").actions()
+        actions = getMultiAdapter((self.context, self.request),
+                                   name=u'plone_context_state').actions()
+        actions_tabs = []
+        try:
+            # Plone 4 and higher
+            import plone.app.upgrade
+            plone.app.upgrade  # pyflakes
+        except ImportError:
+            actions_tabs = actions
+        if not actions_tabs and 'portal_tabs' in actions:
+            actions_tabs = actions['portal_tabs']
+
         portal_tabs_view = getMultiAdapter((self.context, self.request),
             name="portal_tabs_view")
-        if 'portal_tabs' in actions:
-            actions_tabs = actions['portal_tabs']
-        else:
-            actions_tabs = []
         return portal_tabs_view.topLevelTabs(actions=actions_tabs)
 
@@ -513,5 +519,6 @@
         ksscore = self.getCommandSet("core")
         content = self.getGeneratedTabs()
-        ksscore.replaceInnerHTML(ksscore.getHtmlIdSelector('roottabs'), content)
+        ksscore.replaceInnerHTML(ksscore.getHtmlIdSelector('roottabs'),
+                                 content)
 
         # update global-sections viewlet
@@ -531,7 +538,6 @@
 
         if obj_id not in portal.objectIds():
-            raise KSSExplicitError, \
-                  _(u"Object with '${id}' id doesn't exist in portal root.",
-                    mapping={'id': obj_id})
+            raise KSSExplicitError("Object with %s id doesn't" +\
+                                   " exist in portal root." % obj_id)
 
         if checked == '1':
@@ -548,9 +554,9 @@
                 value="invisible")
             message = _(u"'${id}' object was included into navigation.",
-                        mapping={'id':obj_id})
+                        mapping={'id': obj_id})
         else:
             ksscore.addClass(ksscore.getHtmlIdSelector(id), value="invisible")
             message = _(u"'${id}' object was excluded from navigation.",
-                        mapping={'id':obj_id})
+                        mapping={'id': obj_id})
 
         # update global-sections viewlet
@@ -574,9 +580,9 @@
                 value="invisible")
             message = _(u"'${id}' action is now visible.",
-                        mapping={'id':act_id})
+                        mapping={'id': act_id})
         else:
             ksscore.addClass(ksscore.getHtmlIdSelector(id), value="invisible")
             message = _(u"'${id}' action is now invisible.",
-                        mapping={'id':act_id})
+                        mapping={'id': act_id})
         self.updatePage(cat_name)
 
@@ -602,5 +608,5 @@
         # issue portal status message
         self.kss_issueMessage(_(u"'${id}' action successfully removed.",
-                                mapping={'id':act_id}))
+                                mapping={'id': act_id}))
 
     @kssaction
@@ -615,5 +621,4 @@
         # if not errors find (or create) category and set action to it
         ksscore = self.getCommandSet('core')
-        kssplone = self.getCommandSet('plone')
         if not errors:
             action = self.addAction(cat_name, data)
@@ -621,7 +626,8 @@
             # update client
             # add one more action to actions list
-            content = self.getActionsList(category=cat_name, tabs=[action,])
-            ksscore.insertHTMLAsLastChild(ksscore.getHtmlIdSelector('tabslist'),
-                 content)
+            content = self.getActionsList(category=cat_name, tabs=[action, ])
+            ksscore.insertHTMLAsLastChild(
+                                         ksscore.getHtmlIdSelector('tabslist'),
+                                         content)
 
             # update reorder controls
@@ -646,5 +652,5 @@
 
             message = _(u"'${id}' action successfully added.",
-                        mapping={'id':action.id})
+                        mapping={'id': action.id})
             msgtype = "info"
 
@@ -655,6 +661,6 @@
             if errors.has_key('id') or errors.has_key('available_expr'):
                 self.kss_toggleCollapsible(
-                    ksscore.getCssSelector('form[name=addaction_form] '
-                                           '.headerAdvanced'), collapse='false')
+                   ksscore.getCssSelector('form[name=addaction_form] '
+                                          '.headerAdvanced'), collapse='false')
 
             message = _(u"Please correct the indicated errors.")
@@ -678,6 +684,6 @@
         # collapse advanced section
         self.kss_toggleCollapsible(
-            ksscore.getCssSelector('form[name=addaction_form] .headerAdvanced'),
-            collapse='true')
+           ksscore.getCssSelector('form[name=addaction_form] .headerAdvanced'),
+                                  collapse='true')
 
         # reset form inputs
@@ -705,5 +711,5 @@
         # update client
         ksscore = self.getCommandSet("core")
-        content = self.getActionsList(category=cat_name, tabs=[action_info,])
+        content = self.getActionsList(category=cat_name, tabs=[action_info, ])
         ksscore.replaceHTML(ksscore.getHtmlIdSelector(id), content)
 
@@ -722,5 +728,5 @@
         # update client
         ksscore = self.getCommandSet("core")
-        content = self.getActionsList(category=cat_name, tabs=[action,])
+        content = self.getActionsList(category=cat_name, tabs=[action, ])
         ksscore.replaceHTML(ksscore.getHtmlIdSelector(id), content)
 
@@ -743,5 +749,4 @@
         html_id = '%s%s%s' % (self.prefix, id, self.sufix)
         ksscore = self.getCommandSet('core')
-        kssplone = self.getCommandSet('plone')
         if not errors:
             action = self.updateAction(id, cat_name, data)
@@ -749,9 +754,9 @@
             # update client
             # replace action item with updated one
-            content = self.getActionsList(category=cat_name, tabs=[action,])
+            content = self.getActionsList(category=cat_name, tabs=[action, ])
             ksscore.replaceHTML(ksscore.getHtmlIdSelector(html_id), content)
 
             message = _(u"'${id}' action successfully updated.",
-                        mapping={'id':action.id})
+                        mapping={'id': action.id})
             msgtype = "info"
 
@@ -820,5 +825,5 @@
     def copyAction(self, action):
         """Copy action to dictionary"""
-        action_info = {'description':action.description}
+        action_info = {'description': action.description}
         for attr in ACTION_ATTRS:
             action_info[attr] = getattr(action, attr)
@@ -842,5 +847,5 @@
             chooser.checkName(data['id'], self.context)
         except Exception, e:
-            errors['id'] = self._formatError(e, **{'id':data['id']})
+            errors['id'] = self._formatError(e, **{'id': data['id']})
 
         # validate action name
@@ -968,7 +973,6 @@
             category = self.getActionCategory(cat_name)
         except Exception:
-            raise KSSExplicitError, \
-                  _(u"'${cat_name}' action category does not exist.",
-                    mapping={'cat_name': cat_name})
+            raise KSSExplicitError(u"%s action category does not exist." %\
+                                   cat_name)
 
         # extract action id from given list item id on client
@@ -978,7 +982,6 @@
             action = category[action_id]
         except Exception:
-            raise KSSExplicitError, \
-                  _(u"No '${id}' action in '${cat_name}' category.",
-                    mapping={'id': action_id, 'cat_name': cat_name})
+            raise KSSExplicitError("No %s action in %s category." %\
+                                              (action_id, cat_name))
 
         return (action_id, category, action)
@@ -1001,5 +1004,6 @@
                 '.error-container' % (id, UI_ATTRS.get(name, name)))
         else:
-            field_selector = ksscore.getCssSelector('form[name=addaction_form] '
+            field_selector = ksscore.getCssSelector('form' +\
+                '[name=addaction_form] '
                 '.field-%s' % UI_ATTRS.get(name, name))
             field_error_selector = ksscore.getCssSelector('form[name='
@@ -1023,17 +1027,16 @@
                                            selector)
         if collapsed is not None:
-            data = command.addParam('collapsed', collapsed)
+            command.addParam('collapsed', collapsed)
         if expanded is not None:
-            data = command.addParam('expanded', expanded)
+            command.addParam('expanded', expanded)
         if collapse is not None:
-            data = command.addParam('collapse', collapse)
+            command.addParam('collapse', collapse)
 
     def kss_resetForm(self, selector):
         """KSS Server command to reset form on client"""
-        command = self.commands.addCommand('plonetabs-resetForm', selector)
 
     def kss_blur(self, selector):
         """KSS Server command to remove focus from input"""
-        command = self.commands.addCommand('plonetabs-blur', selector)
+        self.commands.addCommand('plonetabs-blur', selector)
 
     def kss_replaceOrInsert(self, selector, parentSelector, html,
@@ -1044,23 +1047,24 @@
         command = self.commands.addCommand('plonetabs-replaceOrInsert',
             selector)
-        data = command.addParam('selector', parentSelector)
-        data = command.addHtmlParam('html', html)
-        data = command.addParam('withKssSetup', withKssSetup)
+        command.addParam('selector', parentSelector)
+        command.addHtmlParam('html', html)
+        command.addParam('withKssSetup', withKssSetup)
         if alternativeHTML:
-            data = command.addHtmlParam('alternativeHTML', alternativeHTML)
+            command.addHtmlParam('alternativeHTML', alternativeHTML)
         if selectorType:
-            data = command.addParam('selectorType', selectorType)
+            command.addParam('selectorType', selectorType)
         if position:
-            data = command.addParam('position', position)
+            command.addParam('position', position)
         if positionSelector:
-            data = command.addParam('positionSelector', positionSelector)
+            command.addParam('positionSelector', positionSelector)
         if positionSelectorType:
-            data = command.addParam('positionSelectorType',
-                                    positionSelectorType)
+            command.addParam('positionSelectorType',
+                              positionSelectorType)
 
     def kss_issueMessage(self, message, msgtype="info"):
         """"Issues portal status message and removes it afte 10 seconds"""
         ksscore = self.getCommandSet('core')
-        self.getCommandSet('plone').issuePortalMessage(message, msgtype=msgtype)
+        self.getCommandSet('plone').issuePortalMessage(message,
+                                                       msgtype=msgtype)
         self.kss_timeout(
             ksscore.getHtmlIdSelector('kssPortalMessage'),
@@ -1071,5 +1075,5 @@
     def kss_timeout(self, selector, **kw):
         """KSS Server command to execute plonetabs-timeout client action"""
-        command = self.commands.addCommand('plonetabs-timeout', selector, **kw)
+        self.commands.addCommand('plonetabs-timeout', selector, **kw)
 
     def renderViewlet(self, manager, name):
@@ -1117,5 +1121,5 @@
         """Delete action with given id from given category"""
         category = self.getActionCategory(cat_name)
-        category.manage_delObjects(ids=[id,])
+        category.manage_delObjects(ids=[id, ])
         return True
 
@@ -1125,7 +1129,7 @@
             category = self.getActionCategory(cat_name)
             if steps > 0:
-                category.moveObjectsUp([id,], steps)
+                category.moveObjectsUp([id, ], steps)
             else:
-                category.moveObjectsDown([id,], abs(steps))
+                category.moveObjectsDown([id, ], abs(steps))
             return True
         return False
@@ -1170,7 +1174,7 @@
         #ksszope = self.getCommandSet("zope")
         #ksszope.refreshViewlet(
-            #self.getCommandSet("core").getHtmlIdSelector("portal-siteactions"),
-            #"plone.portalheader",
-            #"plone.site_actions")
+           #self.getCommandSet("core").getHtmlIdSelector("portal-siteactions"),
+           #"plone.portalheader",
+           #"plone.site_actions")
 
     def updateUserPageSection(self):
@@ -1183,4 +1187,5 @@
             "plone.personal_bar")
 
+
 class PloneTabsMode(BrowserView):
 
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/config.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/config.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/config.py	(revision 3437)
@@ -1,2 +1,2 @@
 PROPERTY_SHEET = "tabs_properties"
-FIELD_NAME     = "titles"
+FIELD_NAME = "titles"
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/interfaces.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/interfaces.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/interfaces.py	(revision 3437)
@@ -1,3 +1,4 @@
 from zope.interface import Interface
+
 
 class IPloneTabsProductLayer(Interface):
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-# I'm a package
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/setuphandlers.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/setuphandlers.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/setuphandlers.py	(revision 3437)
@@ -1,3 +1,4 @@
 from Products.CMFCore.utils import getToolByName
+
 
 def cleanUpControlPanel(portal, out):
@@ -7,4 +8,5 @@
         out.append('plonetabs configlet unregistered.')
 
+
 def uninstall(context):
     # Only run step if a flag file is present (e.g. not an extension profile)
@@ -13,4 +15,4 @@
     out = []
     site = context.getSite()
-    
+
     cleanUpControlPanel(site, out)
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-#
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/base.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/base.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/base.py	(revision 3437)
@@ -1,14 +1,12 @@
 try:
     from zope.annotation.interfaces import IAnnotations
+    IAnnotations  # pyflakes
 except ImportError:
     from zope.app.annotation.interfaces import IAnnotations
-
 from plone.browserlayer.layer import mark_layer
 
 from  Testing import ZopeTestCase as ztc
 from  Products.Five import zcml
-from  Products.Five import fiveconfigure
 from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.interfaces import IAction, IActionCategory
 from Products.CMFCore.ActionInformation import Action, ActionCategory
 from  Products.PloneTestCase import PloneTestCase as ptc
@@ -18,4 +16,5 @@
 
 #ztc.installProduct('Zope2Product')
+
 
 @onsetup
@@ -27,20 +26,23 @@
 
 setup_package()
+if ptc.PLONE30:
+    ptc.setupPloneSite(products=["plone.browserlayer"])
 ptc.setupPloneSite(products=['quintagroup.plonetabs'])
 
 _marker = object()
 
+
 class PloneTabsTestCase(ptc.PloneTestCase):
     """Common test base class"""
-    
+
     def afterSetUp(self):
         # due to some reason plone.browserlayer is not marking REQUEST
         # with installed products layer interfaces
-        # so I'm doing it manually here 
+        # so I'm doing it manually here
         class DummyEvent(object):
             def __init__(self, request):
                 self.request = request
         mark_layer(self.portal, DummyEvent(self.portal.REQUEST))
-    
+
     def purgeCache(self, request):
         annotations = IAnnotations(request)
@@ -48,5 +50,5 @@
         if cache is not _marker:
             del annotations['plone.memoize']
-    
+
     def purgeActions(self):
         for obj in self.tool.objectValues():
@@ -56,5 +58,5 @@
             #elif IActionCategory.providedBy(obj):
                 #obj.manage_delObjects(ids=obj.objectIds())
-    
+
     def setupActions(self, parent, kids=PORTAL_ACTIONS):
         ids = parent.objectIds()
@@ -68,9 +70,9 @@
                 if child.get('children', {}):
                     self.setupActions(getattr(parent, id), child['children'])
-    
+
     def purgeContent(self):
         ids = [obj.id for obj in self.portal.listFolderContents()]
         self.portal.manage_delObjects(ids=ids)
-    
+
     def setupContent(self, parent, kids=PORTAL_CONTENT):
         ids = parent.objectIds()
@@ -80,14 +82,14 @@
             if child.get('children', {}) and id in ids:
                 self.setupContent(getattr(parent, id), child['children'])
-    
+
     def _createType(self, container, portal_type, id, **kwargs):
         """Helper method to create content objects"""
         ttool = getToolByName(container, 'portal_types')
-        portal_catalog =  getToolByName(container, 'portal_catalog')
-    
+        portal_catalog = getToolByName(container, 'portal_catalog')
+
         fti = ttool.getTypeInfo(portal_type)
         fti.constructInstance(container, id, **kwargs)
         obj = getattr(container.aq_inner.aq_explicit, id)
-    
+
         # publish and reindex
         #self._publish_item(portal, obj)
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-#
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/ecmaview.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/ecmaview.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/ecmaunits/ecmaview.py	(revision 3437)
@@ -2,4 +2,5 @@
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from kss.core.tests.ecmaview import EcmaView as base
+
 
 def absolute_dir(path):
@@ -7,7 +8,8 @@
     return os.path.abspath(os.path.join(here, path))
 
+
 class EcmaView(base):
     '''quintagroup.plonetabs js test view
-    
+
     This allows the runner.html to be used on this view.
 
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/__init__.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/__init__.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/__init__.py	(revision 3437)
@@ -1,1 +1,0 @@
-#
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/zopeconfig.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/zopeconfig.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/selenium/zopeconfig.py	(revision 3437)
@@ -4,6 +4,5 @@
     KSSSeleniumTestCase
 
-from plone.app.kss.demo.zopeconfig import PloneSiteLayer, \
-    LoggedInManagerLayer, LoggedInUserLayer, IResource
+from plone.app.kss.demo.zopeconfig import LoggedInManagerLayer, IResource
 
 
@@ -14,6 +13,6 @@
 # for your own programs, or otherwise you will need to change
 # it later. The test suite creation interface will change in
-# the next kss.demo versions. The plugin class (PloneDemos) 
-# will change in the next major KSS (and possibly Plone) version. 
+# the next kss.demo versions. The plugin class (PloneDemos)
+# will change in the next major KSS (and possibly Plone) version.
 # This configuration file will be kept up-to-date to these changes.
 #
@@ -26,4 +25,5 @@
     teardown = KSSSeleniumTestCase('uninstall-tabs.html')
 
+
 class PloneTabsSeleniumKssTests(object):
     implements(IResource)
@@ -33,8 +33,9 @@
     selenium_tests = (
         KSSSeleniumTestSuite(
-            tests = KSSSeleniumTestDirectory('selenium_tests/run_as_testmanager'),
-            layer = PortalTabsLayer,
-            component = 'quintagroup.plonetabs',
-            application = 'quintagroup.plonetabs',
+            tests=KSSSeleniumTestDirectory('selenium_tests/' +\
+                                           'run_as_testmanager'),
+            layer=PortalTabsLayer,
+            component='quintagroup.plonetabs',
+            application='quintagroup.plonetabs',
         ),
     )
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_controlpanel.py	(revision 3437)
@@ -6,15 +6,16 @@
 
 from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.ActionInformation import Action, ActionCategory
+from Products.CMFCore.ActionInformation import Action
 
 from quintagroup.plonetabs import messageFactory as _
 from quintagroup.plonetabs.browser.interfaces import IPloneTabsControlPanel
-from quintagroup.plonetabs.browser.plonetabs import PloneTabsControlPanel as ptp
+from quintagroup.plonetabs.browser.plonetabs \
+                                      import PloneTabsControlPanel as ptp
 from quintagroup.plonetabs.tests.base import PloneTabsTestCase
 from quintagroup.plonetabs.tests.data import PORTAL_ACTIONS
 
+
 class TestControlPanelHelperMethods(PloneTabsTestCase):
     """Test here configlet helper methods"""
-    
     def afterSetUp(self):
         super(TestControlPanelHelperMethods, self).afterSetUp()
@@ -25,9 +26,9 @@
         self.panel = panel.__of__(self.portal)
         self.tool = getToolByName(self.portal, 'portal_actions')
-    
+
     def test_redirect(self):
         response = self.portal.REQUEST.RESPONSE
         method = self.panel.redirect
-        portal_url =  getMultiAdapter((self.portal, self.portal.REQUEST),
+        portal_url = getMultiAdapter((self.portal, self.portal.REQUEST),
                                       name=u"plone_portal_state").portal_url()
         url = '%s/@@plonetabs-controlpanel' % portal_url
@@ -35,5 +36,5 @@
         self.assertEquals(response.headers.get('location', ''), url,
             'Redirect method is not working properly.')
-        
+
         # check query string and anchor hash
         method('http://quintagroup.com', 'q=test', 'hash_code')
@@ -41,12 +42,13 @@
             'http://quintagroup.com?q=test#hash_code',
             'Redirect method is not working properly.')
-    
+
     def test_fixExpression(self):
         method = self.panel.fixExpression
         self.assertEquals(method('/slash'), 'string:${portal_url}/slash')
-        self.assertEquals(method('https://test.com'), 'string:https://test.com')
+        self.assertEquals(method('https://test.com'),
+                                 'string:https://test.com')
         self.assertEquals(method('python:True'), 'python:True')
         self.assertEquals(method('hello'), 'string:${object_url}/hello')
-    
+
     def test_copyAction(self):
         data = PORTAL_ACTIONS[0][1]['children'][0][1]
@@ -55,5 +57,5 @@
         self.assertEquals(len(info.keys()), 6)
         self.assertEquals(info['description'], 'The most important place')
-    
+
     def test_validateActionFields(self):
         method = self.panel.validateActionFields
@@ -63,17 +65,20 @@
         self.assertEquals(errors, {},
             'There should be no errors for valid data.')
-        
-        bad_data = {'id':'',
+
+        bad_data = {'id': '',
                     'title': ' ',
                     'available_expr': 'bad_type:test',
                     'url_expr': 'bad_type:test'}
-        
+
         # Revert PloneTestCase's optimization
         # because this breaks our test
+        from Products.CMFCore.Expression import getEngine
+        from Products.CMFCore.Expression import Expression
+
         def __init__(self, text):
             self.text = text
             if text.strip():
                 self._v_compiled = getEngine().compile(text)
-        from Products.CMFCore.Expression import Expression
+
         optimized__init__ = Expression.__init__
         Expression.__init__ = __init__
@@ -81,11 +86,12 @@
         # rollback our patch
         Expression.__init__ = optimized__init__
-        
+
         self.assertEquals(len(errors.keys()), 4,
             'validateActionFields method is not working properly.')
-    
+        #### pyflakes.scripts.pyflakes ends.
+
     def test_processErrors(self):
         method = self.panel.processErrors
-        errors = {'error':'error message'}
+        errors = {'error': 'error message'}
         self.assertEquals(method(errors), errors,
             'processErrors method is not working properly.')
@@ -93,5 +99,5 @@
             {'pre_error_post': 'error message'},
             'processErrors method is not working properly.')
-    
+
     def test_parseEditForm(self):
         method = self.panel.parseEditForm
@@ -110,8 +116,8 @@
                              'visible': True}),
             'parseEditForm method is not working properly.')
-        
+
         del form['orig_id']
         self.failUnlessRaises(KeyError, method, form)
-    
+
     def test_parseAddForm(self):
         method = self.panel.parseAddForm
@@ -129,17 +135,17 @@
                              'available_expr': 'expr2'}),
             'parseAddForm method is not working properly.')
-        
+
         del form['id']
         self.failUnlessRaises(KeyError, method, form)
-    
+
     def test_getActionCategory(self):
         method = self.panel.getActionCategory
         self.purgeActions()
         self.failUnlessRaises(KeyError, method, 'portal_tabs')
-        
+
         self.setupActions(self.tool)
         self.assertEquals(method('portal_tabs').id, 'portal_tabs',
             'getActionCategory is not working properly.')
-    
+
     def test_getOrCreateCategory(self):
         method = self.panel.getOrCreateCategory
@@ -147,5 +153,5 @@
         self.assertEquals(method('portal_tabs').id, 'portal_tabs',
             'getOrCreateCategory is not working properly.')
-    
+
     def test_setSiteProperties(self):
         self.panel.setSiteProperties(title='Test Title')
@@ -153,5 +159,5 @@
         self.assertEquals(sp.getProperty('title'), 'Test Title',
             'setSiteProperties method is not working properly.')
-    
+
     def test_renderViewlet(self):
         # register test viewlet and it's manager
@@ -161,9 +167,12 @@
         from zope.publisher.interfaces.browser import IDefaultBrowserLayer
         from zope.publisher.interfaces.browser import IBrowserView
+
         class TestViewlet(ViewletBase):
             def __of__(self, obj):
                 return self
+
             def render(self):
                 return 'test viewlet'
+
         provideAdapter(
             TestViewlet,
@@ -176,22 +185,22 @@
             IViewletManager,
             name=u'test_manager')
-        
+
         self.assertEquals(
             self.panel.renderViewlet('test_manager', 'test_viewlet'),
             'test viewlet',
             'renderViewlet method is not workig properly')
-    
+
     def test_addAction(self):
         self.purgeActions()
-        self.panel.addAction('new_category', {'id':'id1', 'title':'Test'})
+        self.panel.addAction('new_category', {'id': 'id1', 'title': 'Test'})
         self.failUnless('id1' in self.tool.new_category.objectIds(),
             'addAction method is not workig properly')
-    
+
     def test_updateAction(self):
         method = self.panel.updateAction
-        
-        self.purgeActions()
-        self.failUnlessRaises(KeyError, method, 'id1', 'cat1', {'id':'new'})
-        
+
+        self.purgeActions()
+        self.failUnlessRaises(KeyError, method, 'id1', 'cat1', {'id': 'new'})
+
         self.setupActions(self.tool)
         # we need to commit transaction because
@@ -199,8 +208,8 @@
         import transaction
         transaction.savepoint()
-        method('home', 'portal_tabs', {'id':'new_home'})
+        method('home', 'portal_tabs', {'id': 'new_home'})
         self.failUnless('new_home' in self.tool.portal_tabs.objectIds(),
             'updateAction method is not workig properly')
-    
+
     def test_deleteAction(self):
         self.purgeActions()
@@ -209,5 +218,5 @@
         self.failIf('home' in self.tool.portal_tabs.objectIds(),
              'deleteAction method is not workig properly')
-    
+
     def test_moveAction(self):
         self.purgeActions()
@@ -223,5 +232,5 @@
 class TestControlPanelAPIMethods(PloneTabsTestCase):
     """Test here interface methods of control panel class"""
-    
+
     def afterSetUp(self):
         super(TestControlPanelAPIMethods, self).afterSetUp()
@@ -232,5 +241,5 @@
         self.panel = panel.__of__(self.portal)
         self.tool = getToolByName(self.portal, 'portal_actions')
-    
+
     def test_interface(self):
         self.failUnless(IPloneTabsControlPanel.implementedBy(ptp),
@@ -238,5 +247,5 @@
         self.failUnless(verifyClass(IPloneTabsControlPanel, ptp),
             'PloneTabs control panel does not implement required interface.')
-    
+
     def test_getPageTitle(self):
         self.assertEquals(self.panel.getPageTitle(),
@@ -247,5 +256,5 @@
               mapping={'cat_name': 'notexists'}),
             'getPageTitle method is broken')
-    
+
     def test_hasActions(self):
         method = self.panel.hasActions
@@ -254,10 +263,10 @@
         self.failIf(method(),
             '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')
-    
+
     def test_getPortalActions(self):
         method = self.panel.getPortalActions
@@ -266,14 +275,14 @@
         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.')
-        
+
         # marginal arguments
         self.assertEquals(len(method('notexistent_category')), 0,
             'There should be no actions for not existed category.')
-    
+
     def test_isGeneratedTabs(self):
         method = self.panel.isGeneratedTabs
@@ -282,5 +291,5 @@
         sp.manage_changeProperties(disable_folder_sections=True)
         self.failIf(method(), 'But folder sections are disabled...')
-    
+
     def test_isNotFoldersGenerated(self):
         method = self.panel.isNotFoldersGenerated
@@ -289,5 +298,5 @@
         sp.manage_changeProperties(disable_nonfolderish_sections=True)
         self.failIf(method(), 'But non folderish sections are disabled...')
-    
+
     def test_getActionsList(self):
         method = self.panel.getActionsList
@@ -299,5 +308,5 @@
         self.failUnless('class="editform"' in method(),
             'There are no actions in actions list template.')
-    
+
     def test_getAutoGenereatedSection(self):
         method = self.panel.getAutoGenereatedSection
@@ -308,5 +317,5 @@
             'There should be form in autogenerated tabs template '
             'for portal_tabs category.')
-    
+
     def test_getGeneratedTabs(self):
         self.panel.getGeneratedTabs()
@@ -316,5 +325,5 @@
             'Mon, 26 Jul 1996 05:00:00 GMT',
             'Expiration header is not set properly.')
-    
+
     def test_getRootTabs(self):
         method = self.panel.getRootTabs
@@ -323,10 +332,10 @@
         self.assertEquals(len(method()), 0,
             'There should be no root elements for navigation.')
-        
+
         # now add some testing content
         self.setupContent(self.portal)
         self.assertEquals(len(method()), 2,
             'There should be 2 elements in portal root for navigation.')
-        
+
         # now switch off autogeneration
         sp = getToolByName(self.portal, 'portal_properties').site_properties
@@ -335,5 +344,5 @@
             'There should be no root elements for navigation when '
             'tabs autogeneration is switched off.')
-    
+
     def test_getCategories(self):
         method = self.panel.getCategories
@@ -342,10 +351,10 @@
         self.assertEquals(len(method()), 0,
             'There should be no categories in portal_actions tool.')
-        
+
         # now setup actions
         self.setupActions(self.tool)
         self.assertEquals(method(), ['portal_tabs', 'new_category'],
             'There should be exactly 2 categories in portal_actions tool.')
-    
+
     def test_portal_tabs(self):
         method = self.panel.portal_tabs
@@ -354,20 +363,20 @@
         self.assertEquals(len(method()), 0,
             'There should be no portal tabs.')
-        
+
         # cleanup memoize cache
         # cause actions method of portal context state is caching it's
         # results in request and we have the same request for every call
         self.purgeCache(self.portal.REQUEST)
-        
+
         # add actions
         self.setupActions(self.tool)
         self.assertEquals(len(method()), 2,
             'There should be 2 portal tabs.')
-        
+
         # add content
         self.setupContent(self.portal)
         self.assertEquals(len(method()), 4,
             'There should be 4 portal tabs.')
-    
+
     def test_selected_portal_tab(self):
         self.assertEquals(self.panel.selected_portal_tab(), 'index_html',
@@ -381,5 +390,5 @@
 class TestControlPanelManageMethods(PloneTabsTestCase):
     """Test here management methods of control panel class"""
-    
+
     def afterSetUp(self):
         super(TestControlPanelManageMethods, self).afterSetUp()
@@ -390,9 +399,9 @@
         self.panel = panel.__of__(self.portal)
         self.tool = getToolByName(self.portal, 'portal_actions')
-        
+
         # purge standard set of actions and set our own testing ones
         self.purgeActions()
         self.setupActions(self.tool)
-    
+
     def test_manage_setAutogeneration(self):
         self.setupContent(self.portal)
@@ -405,5 +414,5 @@
         self.failIf(sp.disable_folder_sections)
         self.failUnless(sp.disable_nonfolderish_sections)
-    
+
     def test_manage_addAction(self):
         self.purgeActions()
@@ -418,5 +427,5 @@
         self.failIf(postback,
             'There should be redirect after successfull adding.')
-    
+
     def test_manage_editAction(self):
         method = self.panel.manage_editAction
@@ -432,13 +441,13 @@
         import transaction
         transaction.savepoint()
-        
+
         postback = method(form, {})
         self.failUnless('id_new' in self.tool.portal_tabs.objectIds())
         self.failIf(postback,
             'There should be redirect after successfull edition.')
-        
+
         form['category'] = 'non_existent'
         self.failUnlessRaises(KeyError, method, form, {})
-    
+
     def test_manage_deleteAction(self):
         self.purgeActions()
@@ -453,5 +462,5 @@
         self.panel.manage_deleteAction(form, {})
         self.failIf('home' in self.tool.portal_tabs.objectIds())
-    
+
     def test_manage_moveUpAction(self):
         self.purgeActions()
@@ -467,5 +476,5 @@
         self.assertEquals(
             self.tool.portal_tabs.getObjectPosition('quintagroup'), 0)
-    
+
     def test_manage_moveDownAction(self):
         self.purgeActions()
@@ -487,5 +496,5 @@
     suite.addTest(unittest.makeSuite(TestControlPanelAPIMethods))
     suite.addTest(unittest.makeSuite(TestControlPanelManageMethods))
-    
+
     # these tests are implemented as Selenium KSS Tests
     # using kss.demo package, and KSS plugins are tested by means of
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_erase.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_erase.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_erase.py	(revision 3437)
@@ -6,5 +6,5 @@
 from Testing import ZopeTestCase as ztc
 
-from zope.component import getSiteManager
+from zope.app.component.hooks import setHooks, setSite
 
 from plone.browserlayer.utils import registered_layers
@@ -14,4 +14,5 @@
 
 from quintagroup.plonetabs.tests.base import PloneTabsTestCase
+
 
 class TestErase(PloneTabsTestCase):
@@ -23,6 +24,11 @@
         @classmethod
         def setUp(cls):
+
             app = ztc.app()
             portal = app.plone
+
+            # change the active local site manager
+            setHooks()
+            setSite(portal)
 
             # elevate permissions
@@ -33,5 +39,5 @@
             product_name = 'quintagroup.plonetabs'
             if tool.isProductInstalled(product_name):
-                tool.uninstallProducts([product_name,])
+                tool.uninstallProducts([product_name, ])
 
             # drop elevated perms
@@ -43,5 +49,5 @@
     def afterSetUp(self):
         self.loginAsPortalOwner()
-    
+
     def test_actionIcons(self):
         tool = getToolByName(self.portal, 'portal_actionicons')
@@ -49,5 +55,5 @@
         self.failIf('plonetabs' in icon_ids,
             'There should be no plonetabs action icon after uninstall.')
-    
+
     def test_controlPanel(self):
         tool = getToolByName(self.portal, 'portal_controlpanel')
@@ -55,5 +61,5 @@
         self.failIf('plonetabs' in action_ids,
             'There should be no plonetabs configlet after after uninstall.')
-    
+
     def test_cssRegistry(self):
         tool = getToolByName(self.portal, 'portal_css')
@@ -62,13 +68,13 @@
             'There should be no ++resource++plonetabs.css stylesheets after'
             ' uninstall.')
-    
+
     def test_jsRegistry(self):
         tool = getToolByName(self.portal, 'portal_javascripts')
-        
+
         effects = tool.getResource('++resource++pt_effects.js')
         self.failUnless(effects is None,
             'There should be no ++resource++pt_effects.js script after'
             ' uninstall.')
-        
+
         dad = tool.getResource('++resource++sa_dragdrop.js')
         self.failUnless(dad is None,
@@ -86,5 +92,5 @@
             'There should be no ++resource++plonetabsmode.kss sheets after'
             ' uninstall.')
-    
+
     def test_propertiesTool(self):
         tool = getToolByName(self.portal, 'portal_properties')
@@ -99,10 +105,10 @@
             ' after uninstall.'
         )
-    
+
     def test_browserLayer(self):
-        sm = getSiteManager(self.portal)
         layers = [o.__name__ for o in registered_layers()]
         self.failIf('IPloneTabsProductLayer' in layers,
             'There should be no quintagroup.plonetabs layer after uninstall.')
+
 
 def test_suite():
Index: /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_setup.py
===================================================================
--- /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_setup.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/quintagroup/plonetabs/tests/test_setup.py	(revision 3437)
@@ -1,5 +1,3 @@
 import unittest
-
-from zope.component import getSiteManager
 
 from plone.browserlayer.utils import registered_layers
@@ -9,9 +7,10 @@
 from quintagroup.plonetabs.tests.base import PloneTabsTestCase
 
+
 class TestSetup(PloneTabsTestCase):
-    
+
     def afterSetUp(self):
         self.loginAsPortalOwner()
-    
+
     def test_actionIcons(self):
         tool = getToolByName(self.portal, 'portal_actionicons')
@@ -19,5 +18,5 @@
         self.failUnless('plonetabs' in icon_ids,
             'There is no plonetabs action icon in actionicons tool.')
-    
+
     def test_controlPanel(self):
         tool = getToolByName(self.portal, 'portal_controlpanel')
@@ -25,5 +24,5 @@
         self.failUnless('plonetabs' in action_ids,
             'There is no plonetabs action in control panel.')
-    
+
     def test_cssRegistry(self):
         tool = getToolByName(self.portal, 'portal_css')
@@ -31,8 +30,8 @@
         self.failIf(css is None,
             'There is no ++resource++plonetabs.css stylesheets registered.')
-    
+
     def test_jsRegistry(self):
         tool = getToolByName(self.portal, 'portal_javascripts')
-        
+
         prototype = tool.getResource('++resource++prototype.js')
         self.failIf(prototype is None,
@@ -40,9 +39,9 @@
         self.failUnless(prototype._data['enabled'],
             '++resource++prototype.js script is disabled.')
-        
+
         effects = tool.getResource('++resource++pt_effects.js')
         self.failIf(effects is None,
             'There is no ++resource++pt_effects.js script registered.')
-        
+
         dad = tool.getResource('++resource++sa_dragdrop.js')
         self.failIf(dad is None,
@@ -57,5 +56,5 @@
         self.failIf(kss is None,
             'There is no ++resource++plonetabsmode.kss sheets registered.')
-    
+
     def test_propertiesTool(self):
         tool = getToolByName(self.portal, 'portal_properties')
@@ -68,10 +67,10 @@
             'Site properties was not setup properly'
         )
-    
+
     def test_browserLayerRegistered(self):
-        sm = getSiteManager(self.portal)
         layers = [o.__name__ for o in registered_layers()]
         self.failUnless('IPloneTabsProductLayer' in layers,
             'There should be quintagroup.ploentabs browser layer registered.')
+
 
 def test_suite():
Index: /quintagroup.plonetabs/trunk/setup.py
===================================================================
--- /quintagroup.plonetabs/trunk/setup.py	(revision 3436)
+++ /quintagroup.plonetabs/trunk/setup.py	(revision 3437)
@@ -4,5 +4,5 @@
 from setuptools import setup, find_packages
 
-version = '0.7'
+version = '0.7.1-dev'
 
 setup(name='quintagroup.plonetabs',
@@ -12,5 +12,6 @@
                        open(os.path.join("docs", "HISTORY.txt")).read(),
 
-      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      # Get more strings from
+      # http://www.python.org/pypi?%3Aaction=list_classifiers
       classifiers=[
         "Framework :: Plone",
@@ -23,5 +24,6 @@
       author='"Quintagroup": http://quintagroup.com/',
       author_email='support@quintagroup.com',
-      url='http://quintagroup.com/services/plone-development/products/plone-tabs',
+      url='http://quintagroup.com/' +\
+          'services/plone-development/products/plone-tabs',
       license='GPL',
       packages=find_packages(exclude=['ez_setup']),
@@ -31,4 +33,5 @@
       install_requires=[
           'setuptools',
+          'plone.browserlayer'
           # -*- Extra requirements: -*-
       ],
