[Testbot] Plone 4.3 - Python 2.6 - Build # 1944 - Still failing! - failure(s)

jenkins at plone.org jenkins at plone.org
Thu Apr 3 21:43:32 UTC 2014


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 1944 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/1944/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-03-29T21:44:41+01:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/d37a14f89eb47e30f60d321619c044339e55b461

added test to verify #22

Files changed:
M plone/app/querystring/tests/testRegistryIntegration.py

diff --git a/plone/app/querystring/tests/testRegistryIntegration.py b/plone/app/querystring/tests/testRegistryIntegration.py
index 86c6672..94bfdb7 100644
--- a/plone/app/querystring/tests/testRegistryIntegration.py
+++ b/plone/app/querystring/tests/testRegistryIntegration.py
@@ -29,6 +29,24 @@ def test_date_lessthan(self):
         self.assertEqual(registry[prefix + ".operation"],
                          'plone.app.querystring.queryparser:_lessThan')
 
+    def test_getobjpositioninparent_largerthan(self):
+        """Bug reported as Issue #22
+
+        Names not matching for operations getObjPositionInParent
+        see also https://github.com/plone/plone.app.querystring/issues/22
+        """
+        key = 'plone.app.querystring.field.getObjPositionInParent.operations'
+        operation = 'plone.app.querystring.operation.int.largerThan'
+        registry = self.portal.portal_registry
+
+        # pre check if operation exists to be sure
+        op_info = registry.get(operation)
+        self.assertIsNot(op_info, None)
+
+        # check if operation is used for getObjPositionInParent
+        operations = registry.get(key)
+        self.assertTrue(operation in operations)
+
 
 class TestFieldDefinitions(QuerystringTestCase):
 


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-03-29T22:02:47+01:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/e1ac99937614065b574c15f6cafe24229ea6f03e

test need fullregistry testcase, stripped down test to essence

Files changed:
M plone/app/querystring/tests/testRegistryIntegration.py

diff --git a/plone/app/querystring/tests/testRegistryIntegration.py b/plone/app/querystring/tests/testRegistryIntegration.py
index 94bfdb7..e17369d 100644
--- a/plone/app/querystring/tests/testRegistryIntegration.py
+++ b/plone/app/querystring/tests/testRegistryIntegration.py
@@ -29,24 +29,6 @@ def test_date_lessthan(self):
         self.assertEqual(registry[prefix + ".operation"],
                          'plone.app.querystring.queryparser:_lessThan')
 
-    def test_getobjpositioninparent_largerthan(self):
-        """Bug reported as Issue #22
-
-        Names not matching for operations getObjPositionInParent
-        see also https://github.com/plone/plone.app.querystring/issues/22
-        """
-        key = 'plone.app.querystring.field.getObjPositionInParent.operations'
-        operation = 'plone.app.querystring.operation.int.largerThan'
-        registry = self.portal.portal_registry
-
-        # pre check if operation exists to be sure
-        op_info = registry.get(operation)
-        self.assertIsNot(op_info, None)
-
-        # check if operation is used for getObjPositionInParent
-        operations = registry.get(key)
-        self.assertTrue(operation in operations)
-
 
 class TestFieldDefinitions(QuerystringTestCase):
 
@@ -70,3 +52,18 @@ def test_getId(self):
         self.assertEqual(registry[prefix + ".enabled"], True)
         self.assertEqual(registry[prefix + ".sortable"], True)
         self.assertEqual(registry[prefix + ".group"], "Metadata")
+
+    def test_getobjpositioninparent_largerthan(self):
+        """Bug reported as Issue #22
+
+        Names not matching for operations getObjPositionInParent
+        see also https://github.com/plone/plone.app.querystring/issues/22
+        """
+        key = 'plone.app.querystring.field.getObjPositionInParent.operations'
+        operation = 'plone.app.querystring.operation.int.largerThan'
+        registry = self.portal.portal_registry
+
+        # check if operation is used for getObjPositionInParent
+        operations = registry.get(key)
+        self.assertTrue(operation in operations)
+


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-03-29T22:03:20+01:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/6b090a8902777c26da02562c6c87789a54c9709a

fixes bug #22

Files changed:
M plone/app/querystring/profiles/default/registry.xml

diff --git a/plone/app/querystring/profiles/default/registry.xml b/plone/app/querystring/profiles/default/registry.xml
index 07450f9..9d3f610 100644
--- a/plone/app/querystring/profiles/default/registry.xml
+++ b/plone/app/querystring/profiles/default/registry.xml
@@ -314,7 +314,7 @@
         <value key="operations">
             <element>plone.app.querystring.operation.int.is</element>
             <element>plone.app.querystring.operation.int.lessThan</element>
-            <element>plone.app.querystring.operation.int.greaterThan</element>
+            <element>plone.app.querystring.operation.int.largerThan</element>
         </value>
        <value key="group" i18n:translate="">Metadata</value>
     </records>


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-03-29T22:04:50+01:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/f80743256ac46101371803335027a7a3c83a063e

state changes

Files changed:
M CHANGES.rst

diff --git a/CHANGES.rst b/CHANGES.rst
index 00b7c09..c5b9dc0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,9 @@ Changelog
 1.1.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- bugfix for #22: Names not matching for operations getObjPositionInParent
+  plus test
+  [jensens]
 
 
 1.1.1 (2014-01-27)


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-01T18:19:40+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/b4a4ae83c0833a7f537622cd61f7ad078d332bc7

upgrade

Files changed:
A plone/app/querystring/profiles/upgrade_1_to_2/registry.xml
A plone/app/querystring/upgrades.py
M plone/app/querystring/configure.zcml
M plone/app/querystring/profiles/default/metadata.xml
M setup.py

diff --git a/plone/app/querystring/configure.zcml b/plone/app/querystring/configure.zcml
index 300c366..f8951c6 100644
--- a/plone/app/querystring/configure.zcml
+++ b/plone/app/querystring/configure.zcml
@@ -15,6 +15,23 @@
     provides="Products.GenericSetup.interfaces.EXTENSION"
     />
 
+  <genericsetup:registerProfile
+      name="upgrade_1_to_2"
+      title="Upgrade profile v1 to v2"
+      description=""
+      directory="profiles/upgrade_1_to_2"
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+  <genericsetup:upgradeStep
+      source="1"
+      destination="2"
+      title="Fix Typo in Registry"
+      description="Migrate registry to fix a typo."
+      profile="plone.app.querystring:default"
+      handler=".upgrades.upgrade_1_to_2_typo_in_registry"
+      />
+
   <adapter
     for="plone.registry.interfaces.IRegistry"
     factory=".registryreader.QuerystringRegistryReader"
diff --git a/plone/app/querystring/profiles/default/metadata.xml b/plone/app/querystring/profiles/default/metadata.xml
index 06dcbf7..103e8eb 100644
--- a/plone/app/querystring/profiles/default/metadata.xml
+++ b/plone/app/querystring/profiles/default/metadata.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <metadata>
-  <version>1</version>
+  <version>2</version>
   <dependencies>
       <dependency>profile-plone.app.registry:default</dependency>
   </dependencies>
diff --git a/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml b/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml
new file mode 100644
index 0000000..737321a
--- /dev/null
+++ b/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml
@@ -0,0 +1,9 @@
+<registry>
+    <records interface="plone.app.querystring.interfaces.IQueryField"
+             prefix="plone.app.querystring.field.getObjPositionInParent">
+        <value purge="false" key="operations">
+            <element remove="true">plone.app.querystring.operation.int.greaterThan</element>
+            <element>plone.app.querystring.operation.int.largerThan</element>
+        </value>
+    </records>
+</registry>
diff --git a/plone/app/querystring/upgrades.py b/plone/app/querystring/upgrades.py
new file mode 100644
index 0000000..3ad149f
--- /dev/null
+++ b/plone/app/querystring/upgrades.py
@@ -0,0 +1,8 @@
+from Products.CMFCore.utils import getToolByName
+
+def upgrade_1_to_2_typo_in_registry(context):
+    setup = getToolByName(context, 'portal_setup')
+    setup.runImportStepFromProfile(
+        'profile-plone.app.querystring:upgrade_1_to_2',
+        'registry'
+    )
diff --git a/setup.py b/setup.py
index 1f738ef..b757b3c 100644
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,7 @@
           'plone.app.contentlisting',
           'plone.app.layout',
           'plone.app.registry>=1.1dev',
+          'plone.app.upgrades',
           'plone.app.vocabularies',
           'plone.batching',
           'plone.registry',


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-02T00:13:39+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/d3543720272fd25ab379268cb4aed1810dfefe26

-mcrappy GS does not work the way expected, use manual way

Files changed:
M plone/app/querystring/configure.zcml
M plone/app/querystring/upgrades.py
D plone/app/querystring/profiles/upgrade_1_to_2/registry.xml

diff --git a/plone/app/querystring/configure.zcml b/plone/app/querystring/configure.zcml
index f8951c6..6d51c64 100644
--- a/plone/app/querystring/configure.zcml
+++ b/plone/app/querystring/configure.zcml
@@ -15,14 +15,6 @@
     provides="Products.GenericSetup.interfaces.EXTENSION"
     />
 
-  <genericsetup:registerProfile
-      name="upgrade_1_to_2"
-      title="Upgrade profile v1 to v2"
-      description=""
-      directory="profiles/upgrade_1_to_2"
-      provides="Products.GenericSetup.interfaces.EXTENSION"
-      />
-
   <genericsetup:upgradeStep
       source="1"
       destination="2"
diff --git a/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml b/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml
deleted file mode 100644
index 737321a..0000000
--- a/plone/app/querystring/profiles/upgrade_1_to_2/registry.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<registry>
-    <records interface="plone.app.querystring.interfaces.IQueryField"
-             prefix="plone.app.querystring.field.getObjPositionInParent">
-        <value purge="false" key="operations">
-            <element remove="true">plone.app.querystring.operation.int.greaterThan</element>
-            <element>plone.app.querystring.operation.int.largerThan</element>
-        </value>
-    </records>
-</registry>
diff --git a/plone/app/querystring/upgrades.py b/plone/app/querystring/upgrades.py
index 3ad149f..e57559f 100644
--- a/plone/app/querystring/upgrades.py
+++ b/plone/app/querystring/upgrades.py
@@ -1,8 +1,16 @@
-from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.utils import getUtility
+from plone.registry.interfaces import IRegistry
+
 
 def upgrade_1_to_2_typo_in_registry(context):
-    setup = getToolByName(context, 'portal_setup')
-    setup.runImportStepFromProfile(
-        'profile-plone.app.querystring:upgrade_1_to_2',
-        'registry'
-    )
+    registry = getUtility(IRegistry)
+    name = 'plone.app.querystring.field.getObjPositionInParent.operations'
+    wrong_value = 'plone.app.querystring.operation.int.greaterThan'
+    right_value = 'plone.app.querystring.operation.int.largerThan'
+    values = registry[name]
+    import pdb;pdb.set_trace()
+    if wrong_value in values:
+        del values[values.index(wrong_value)]
+    if right_value not in values:
+        values.append(right_value)
+    registry[name] = values


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-02T00:15:11+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/9f05b87057fbcf5a90ce56bb275bd044bf8bf312

merge master

Files changed:
M CHANGES.rst
M plone/app/querystring/queryparser.py
M plone/app/querystring/tests/testQueryParser.py

diff --git a/CHANGES.rst b/CHANGES.rst
index c5b9dc0..56b34b3 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,13 @@ Changelog
   plus test
   [jensens]
 
+- Implement multipath queries:
+  - Parsing a path returns always a list.
+  - Special handling for paths in parseFormquery.
+
+  Fixes https://dev.plone.org/ticket/13251
+  [mathias.leimgruber]
+
 
 1.1.1 (2014-01-27)
 ------------------
diff --git a/plone/app/querystring/queryparser.py b/plone/app/querystring/queryparser.py
index c6023cd..a4ce36e 100644
--- a/plone/app/querystring/queryparser.py
+++ b/plone/app/querystring/queryparser.py
@@ -38,7 +38,12 @@ def parseFormquery(context, formquery, sort_on=None, sort_order=None):
         kwargs = {}
         parser = resolve(row.operator)
         kwargs = parser(context, row)
-        query.update(kwargs)
+
+        # Special path handling - since multipath queries are possible
+        if 'path' in query and 'path' in kwargs:
+            query['path']['query'].extend(kwargs['path']['query'])
+        else:
+            query.update(kwargs)
 
     if not query:
         # If the query is empty fall back onto the equality query
@@ -213,14 +218,16 @@ def _path(context, row):
     if not values.startswith(nav_root):
         values = nav_root + values
 
-    query = {'query': values}
+    query = {}
     if depth is not None:
         query['depth'] = depth
         # when a depth value is specified, a trailing slash matters on the
         # query
-        query['query'] = query['query'].rstrip('/')
-    tmp = {row.index: query}
-    return tmp
+        values = values.rstrip('/')
+
+    query['query'] = [values]
+
+    return {row.index: query}
 
 
 def _relativePath(context, row):
diff --git a/plone/app/querystring/tests/testQueryParser.py b/plone/app/querystring/tests/testQueryParser.py
index e7b823f..71ae8e3 100644
--- a/plone/app/querystring/tests/testQueryParser.py
+++ b/plone/app/querystring/tests/testQueryParser.py
@@ -140,7 +140,8 @@ def test_path_explicit(self):
             'v': '/foo',
         }
         parsed = queryparser.parseFormquery(MockSite(), [data, ])
-        self.assertEqual(parsed, {'path': {'query': '/%s/foo' % MOCK_SITE_ID}})
+        self.assertEqual(
+            parsed, {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}})
 
     def test_path_computed(self):
         data = {
@@ -150,7 +151,8 @@ def test_path_computed(self):
         }
 
         parsed = queryparser.parseFormquery(MockSite(), [data, ])
-        self.assertEqual(parsed, {'path': {'query': '/%s/foo' % MOCK_SITE_ID}})
+        self.assertEqual(
+            parsed, {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}})
 
     def test_path_with_depth_computed(self):
         data = {
@@ -162,11 +164,47 @@ def test_path_with_depth_computed(self):
         parsed = queryparser.parseFormquery(MockSite(), [data, ])
         self.assertEqual(parsed, {
             'path': {
-                'query': '/%s/foo' % MOCK_SITE_ID,
+                'query': ['/%s/foo' % MOCK_SITE_ID],
                 'depth': 2
             }
         })
 
+    def test_multi_path(self):
+        data_1 = {
+            'i': 'path',
+            'o': 'plone.app.querystring.operation.string.path',
+            'v': '/foo',
+        }
+        data_2 = {
+            'i': 'path',
+            'o': 'plone.app.querystring.operation.string.path',
+            'v': '/bar',
+        }
+
+        parsed = queryparser.parseFormquery(MockSite(), [data_1, data_2])
+        self.assertEqual(
+            parsed, {'path': {'query': [
+                '/%s/foo' % MOCK_SITE_ID,
+                '/%s/bar' % MOCK_SITE_ID]}})
+
+    def test_multi_path_with_depth_computet(self):
+        data_1 = {
+            'i': 'path',
+            'o': 'plone.app.querystring.operation.string.path',
+            'v': '/foo::2',
+        }
+        data_2 = {
+            'i': 'path',
+            'o': 'plone.app.querystring.operation.string.path',
+            'v': '/bar::5',
+        }
+
+        parsed = queryparser.parseFormquery(MockSite(), [data_1, data_2])
+        self.assertEqual(
+            parsed, {'path': {'query': [
+                '/%s/foo' % MOCK_SITE_ID,
+                '/%s/bar' % MOCK_SITE_ID], 'depth': 2}})
+
 
 class TestQueryGenerators(TestQueryParserBase):
 
@@ -267,7 +305,7 @@ def test__path(self):
                   operator='_path',
                   values='/news/')
         parsed = queryparser._path(MockSite(), data)
-        expected = {'path': {'query': '/%s/news/' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s/news/' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # by uid
@@ -275,7 +313,7 @@ def test__path(self):
                   operator='_path',
                   values='00000000000000001')
         parsed = queryparser._path(MockSite(), data)
-        expected = {'path': {'query': '/%s/foo' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
     def test__relativePath(self):
@@ -302,7 +340,7 @@ def test__relativePath(self):
                   operator='_relativePath',
                   values='..')
         parsed = queryparser._relativePath(context, data)
-        expected = {'path': {'query': '/%s/bar' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s/bar' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # walk upwards
@@ -310,7 +348,7 @@ def test__relativePath(self):
                   operator='_relativePath',
                   values='../../')
         parsed = queryparser._relativePath(context, data)
-        expected = {'path': {'query': '/%s' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # if you walk beyond INavigatinRoot it should stop and return
@@ -318,7 +356,7 @@ def test__relativePath(self):
                   operator='_relativePath',
                   values='../../../')
         parsed = queryparser._relativePath(context, data)
-        expected = {'path': {'query': '/%s' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # reach a subfolder on Plone root
@@ -326,7 +364,7 @@ def test__relativePath(self):
                    operator='_relativePath',
                    values='../../ham')
         parsed = queryparser._relativePath(context, data)
-        expected = {'path': {'query': '/%s/ham' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s/ham' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # reach a subfolder on parent of collection
@@ -334,7 +372,7 @@ def test__relativePath(self):
                    operator='_relativePath',
                    values='../egg')
         parsed = queryparser._relativePath(context, data)
-        expected = {'path': {'query': '/%s/bar/egg' % MOCK_SITE_ID}}
+        expected = {'path': {'query': ['/%s/bar/egg' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
     def test_getPathByUID(self):


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-02T00:18:12+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/0276f501ebbcbdccb320aa819919981d9259ca12

i want pre commit hooks. also flake 8

Files changed:
M plone/app/querystring/upgrades.py

diff --git a/plone/app/querystring/upgrades.py b/plone/app/querystring/upgrades.py
index e57559f..3d5d5e4 100644
--- a/plone/app/querystring/upgrades.py
+++ b/plone/app/querystring/upgrades.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 from Products.CMFCore.utils import getUtility
 from plone.registry.interfaces import IRegistry
 
@@ -8,7 +9,6 @@ def upgrade_1_to_2_typo_in_registry(context):
     wrong_value = 'plone.app.querystring.operation.int.greaterThan'
     right_value = 'plone.app.querystring.operation.int.largerThan'
     values = registry[name]
-    import pdb;pdb.set_trace()
     if wrong_value in values:
         del values[values.index(wrong_value)]
     if right_value not in values:


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-03T18:23:38+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/56f44346db0d8a53217f9ba9f3741890b952707b

Merge branch 'bugfix-22'

Files changed:
A plone/app/querystring/upgrades.py
M CHANGES.rst
M plone/app/querystring/configure.zcml
M plone/app/querystring/profiles/default/metadata.xml
M plone/app/querystring/profiles/default/registry.xml
M plone/app/querystring/tests/testRegistryIntegration.py
M setup.py

diff --git a/CHANGES.rst b/CHANGES.rst
index d6bc800..8ae2170 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,10 @@ Changelog
 1.2.0 (unreleased)
 ------------------
 
+- bugfix for #22: Names not matching for operations getObjPositionInParent
+  plus test
+  [jensens]
+
 - Implement multipath queries:
 
   - Parsing a path returns always a list.
diff --git a/plone/app/querystring/configure.zcml b/plone/app/querystring/configure.zcml
index 29978d5..6c43b4d 100644
--- a/plone/app/querystring/configure.zcml
+++ b/plone/app/querystring/configure.zcml
@@ -16,6 +16,15 @@
     provides="Products.GenericSetup.interfaces.EXTENSION"
     />
 
+  <genericsetup:upgradeStep
+      source="1"
+      destination="2"
+      title="Fix Typo in Registry"
+      description="Migrate registry to fix a typo."
+      profile="plone.app.querystring:default"
+      handler=".upgrades.upgrade_1_to_2_typo_in_registry"
+      />
+
   <adapter
     for="plone.registry.interfaces.IRegistry"
     factory=".registryreader.QuerystringRegistryReader"
diff --git a/plone/app/querystring/profiles/default/metadata.xml b/plone/app/querystring/profiles/default/metadata.xml
index 06dcbf7..103e8eb 100644
--- a/plone/app/querystring/profiles/default/metadata.xml
+++ b/plone/app/querystring/profiles/default/metadata.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <metadata>
-  <version>1</version>
+  <version>2</version>
   <dependencies>
       <dependency>profile-plone.app.registry:default</dependency>
   </dependencies>
diff --git a/plone/app/querystring/profiles/default/registry.xml b/plone/app/querystring/profiles/default/registry.xml
index 07450f9..9d3f610 100644
--- a/plone/app/querystring/profiles/default/registry.xml
+++ b/plone/app/querystring/profiles/default/registry.xml
@@ -314,7 +314,7 @@
         <value key="operations">
             <element>plone.app.querystring.operation.int.is</element>
             <element>plone.app.querystring.operation.int.lessThan</element>
-            <element>plone.app.querystring.operation.int.greaterThan</element>
+            <element>plone.app.querystring.operation.int.largerThan</element>
         </value>
        <value key="group" i18n:translate="">Metadata</value>
     </records>
diff --git a/plone/app/querystring/tests/testRegistryIntegration.py b/plone/app/querystring/tests/testRegistryIntegration.py
index 86c6672..e17369d 100644
--- a/plone/app/querystring/tests/testRegistryIntegration.py
+++ b/plone/app/querystring/tests/testRegistryIntegration.py
@@ -52,3 +52,18 @@ def test_getId(self):
         self.assertEqual(registry[prefix + ".enabled"], True)
         self.assertEqual(registry[prefix + ".sortable"], True)
         self.assertEqual(registry[prefix + ".group"], "Metadata")
+
+    def test_getobjpositioninparent_largerthan(self):
+        """Bug reported as Issue #22
+
+        Names not matching for operations getObjPositionInParent
+        see also https://github.com/plone/plone.app.querystring/issues/22
+        """
+        key = 'plone.app.querystring.field.getObjPositionInParent.operations'
+        operation = 'plone.app.querystring.operation.int.largerThan'
+        registry = self.portal.portal_registry
+
+        # check if operation is used for getObjPositionInParent
+        operations = registry.get(key)
+        self.assertTrue(operation in operations)
+
diff --git a/plone/app/querystring/upgrades.py b/plone/app/querystring/upgrades.py
new file mode 100644
index 0000000..3d5d5e4
--- /dev/null
+++ b/plone/app/querystring/upgrades.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+from Products.CMFCore.utils import getUtility
+from plone.registry.interfaces import IRegistry
+
+
+def upgrade_1_to_2_typo_in_registry(context):
+    registry = getUtility(IRegistry)
+    name = 'plone.app.querystring.field.getObjPositionInParent.operations'
+    wrong_value = 'plone.app.querystring.operation.int.greaterThan'
+    right_value = 'plone.app.querystring.operation.int.largerThan'
+    values = registry[name]
+    if wrong_value in values:
+        del values[values.index(wrong_value)]
+    if right_value not in values:
+        values.append(right_value)
+    registry[name] = values
diff --git a/setup.py b/setup.py
index 899a1eb..a0c6689 100644
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,7 @@
           'plone.app.contentlisting',
           'plone.app.layout',
           'plone.app.registry>=1.1dev',
+          'plone.app.upgrades',
           'plone.app.vocabularies',
           'plone.batching',
           'plone.registry',


Repository: plone.app.querystring
Branch: refs/heads/master
Date: 2014-04-03T23:41:06+02:00
Author: Jens W. Klein (jensens) <jens at bluedynamics.com>
Commit: https://github.com/plone/plone.app.querystring/commit/25a5c81fe1a89cb6be5af68e8531ae550a7b3b1f

pep8/flake8 cleanup

Files changed:
A plone/app/querystring/tests/registry_minimal_correct.xml
A plone/app/querystring/tests/registry_test_missing_operator.xml
A plone/app/querystring/tests/registry_test_vocabulary.xml
M plone/app/querystring/__init__.py
M plone/app/querystring/indexmodifiers/query_index_modifiers.py
M plone/app/querystring/interfaces.py
M plone/app/querystring/querybuilder.py
M plone/app/querystring/queryparser.py
M plone/app/querystring/registryreader.py
M plone/app/querystring/tests/index_testmodifier.py
M plone/app/querystring/tests/registry_testdata.py
M plone/app/querystring/tests/testQueryBuilder.py
M plone/app/querystring/tests/testQueryBuilderModifiers.py
M plone/app/querystring/tests/testQueryParser.py
M plone/app/querystring/tests/testRegistryIntegration.py
M plone/app/querystring/tests/testRegistryReader.py
M setup.py

diff --git a/plone/app/querystring/__init__.py b/plone/app/querystring/__init__.py
index 4287ca8..792d600 100644
--- a/plone/app/querystring/__init__.py
+++ b/plone/app/querystring/__init__.py
@@ -1 +1 @@
-#
\ No newline at end of file
+#
diff --git a/plone/app/querystring/indexmodifiers/query_index_modifiers.py b/plone/app/querystring/indexmodifiers/query_index_modifiers.py
index 87ef9d1..6bb3981 100644
--- a/plone/app/querystring/indexmodifiers/query_index_modifiers.py
+++ b/plone/app/querystring/indexmodifiers/query_index_modifiers.py
@@ -1,7 +1,7 @@
 # -*- coding: utf8 -*-
-
-from zope.interface import implements
 from plone.app.querystring.interfaces import IParsedQueryIndexModifier
+from zope.interface import implements
+
 
 class Subject(object):
     """
@@ -10,13 +10,13 @@ class Subject(object):
     parsedquery with existing utf-8 encoded string indexes unindexing
     will fail with a UnicodeDecodeError. To prevent this from happening
     we always encode the Subject query.
-    
+
     XXX: As soon as Plone uses unicode for all indexes, this code can
     be removed.
     """
 
     implements(IParsedQueryIndexModifier)
-    
+
     def __call__(self, value):
         query = value['query']
         # query can be a unicode string or a list of unicode strings.
diff --git a/plone/app/querystring/interfaces.py b/plone/app/querystring/interfaces.py
index 333267e..aacf056 100644
--- a/plone/app/querystring/interfaces.py
+++ b/plone/app/querystring/interfaces.py
@@ -1,12 +1,18 @@
 from zope.interface import Interface
-from zope.schema import TextLine, Text, Bool, List, DottedName
+from zope.schema import Bool
+from zope.schema import DottedName
+from zope.schema import List
+from zope.schema import Text
+from zope.schema import TextLine
 
 
 class IQuerystringRegistryReader(Interface):
-    """Adapts a registry object to parse the querystring data"""
+    """Adapts a registry object to parse the querystring data
+    """
 
     def __call__():
-        """Return query string in dict-format."""
+        """Return query string in dict-format.
+        """
 
 
 class IQueryOperation(Interface):
@@ -28,12 +34,12 @@ class IQueryField(Interface):
 
 
 class IParsedQueryIndexModifier(Interface):
-    """Transform a parsed query index in something different"""
-    
+    """Transform a parsed query index in something different
+    """
+
     def __call__(value):
         """
         Return a tuple with a new index name and a new value.
-        if the index name returned is different from the native one, caller must
-        replace treated index with the new ones.
+        if the index name returned is different from the native one, caller
+        must replace treated index with the new ones.
         """
-
diff --git a/plone/app/querystring/querybuilder.py b/plone/app/querystring/querybuilder.py
index f2de412..b2b5ff5 100644
--- a/plone/app/querystring/querybuilder.py
+++ b/plone/app/querystring/querybuilder.py
@@ -75,22 +75,24 @@ def _makequery(self, query=None, batch=False, b_start=0, b_size=30,
             if name in parsedquery:
                 new_name, query = modifier(parsedquery[name])
                 parsedquery[name] = query
-                # if a new index name has been returned, we need to replace the native ones
+                # if a new index name has been returned, we need to replace
+                # the native ones
                 if name != new_name:
                     del parsedquery[name]
                     parsedquery[new_name] = query
 
        # Check for valid indexes
         catalog = getToolByName(self.context, 'portal_catalog')
-        valid_indexes = [index for index in parsedquery if index in catalog.indexes()]
+        valid_indexes = [index for index in parsedquery
+                         if index in catalog.indexes()]
 
-        # We'll ignore any invalid index, but will return an empty set if none of
-        # the indexes are valid.
+        # We'll ignore any invalid index, but will return an empty set if none
+        # of the indexes are valid.
         if not valid_indexes:
             logger.warning(
                 "Using empty query because there are no valid indexes used.")
             parsedquery = {}
-        
+
         if not parsedquery:
             if brains:
                 return []
diff --git a/plone/app/querystring/queryparser.py b/plone/app/querystring/queryparser.py
index c6244fa..36955d0 100644
--- a/plone/app/querystring/queryparser.py
+++ b/plone/app/querystring/queryparser.py
@@ -1,12 +1,11 @@
-from collections import namedtuple
-
 from Acquisition import aq_parent
 from DateTime import DateTime
-from plone.app.layout.navigation.interfaces import INavigationRoot
-from plone.registry.interfaces import IRegistry
 from Products.CMFCore.utils import getToolByName
 from Products.CMFPlone.browser.navtree import getNavigationRoot
 from Products.CMFPlone.utils import base_hasattr
+from collections import namedtuple
+from plone.app.layout.navigation.interfaces import INavigationRoot
+from plone.registry.interfaces import IRegistry
 from zope.component import getUtility
 from zope.dottedname.resolve import resolve
 
@@ -73,29 +72,32 @@ def _isFalse(context, row):
 
 
 def _between(context, row):
-    tmp = {row.index: {
-              'query': sorted(row.values),
-              'range': 'minmax',
-              },
-          }
+    tmp = {row.index:
+           {
+               'query': sorted(row.values),
+               'range': 'minmax',
+           },
+           }
     return tmp
 
 
 def _largerThan(context, row):
-    tmp = {row.index: {
-              'query': row.values,
-              'range': 'min',
-              },
-          }
+    tmp = {row.index:
+           {
+               'query': row.values,
+               'range': 'min',
+           },
+           }
     return tmp
 
 
 def _lessThan(context, row):
-    tmp = {row.index: {
-              'query': row.values,
-              'range': 'max',
-              },
-          }
+    tmp = {row.index:
+           {
+               'query': row.values,
+               'range': 'max',
+           },
+           }
     return tmp
 
 
@@ -103,10 +105,7 @@ def _currentUser(context, row):
     """Current user lookup"""
     mt = getToolByName(context, 'portal_membership')
     user = mt.getAuthenticatedMember()
-    return {row.index: {
-              'query': user.getUserName(),
-              },
-          }
+    return {row.index: {'query': user.getUserName()}}
 
 
 def _lessThanRelativeDate(context, row):
diff --git a/plone/app/querystring/registryreader.py b/plone/app/querystring/registryreader.py
index 2842f23..8060a2f 100644
--- a/plone/app/querystring/registryreader.py
+++ b/plone/app/querystring/registryreader.py
@@ -1,17 +1,16 @@
+from .interfaces import IQuerystringRegistryReader
 from operator import attrgetter
-import logging
-
 from zope.component import queryUtility
-from zope.interface import implements
 from zope.globalrequest import getRequest
 from zope.i18n import translate
 from zope.i18nmessageid import Message
+from zope.interface import implements
 from zope.schema.interfaces import IVocabularyFactory
-
-from .interfaces import IQuerystringRegistryReader
+import logging
 
 logger = logging.getLogger("plone.app.querystring")
 
+
 class DottedDict(dict):
     """A dictionary where you can access nested dicts with dotted names"""
 
diff --git a/plone/app/querystring/tests/index_testmodifier.py b/plone/app/querystring/tests/index_testmodifier.py
index a4e56d0..daa87fe 100644
--- a/plone/app/querystring/tests/index_testmodifier.py
+++ b/plone/app/querystring/tests/index_testmodifier.py
@@ -6,18 +6,18 @@
 
 class SimpleFooIndexModifier(object):
     """Test simple index modifier that do nothing"""
-    
+
     implements(IParsedQueryIndexModifier)
-    
+
     def __call__(self, value):
         raise Exception("SimpleFooIndexModifier has been called!")
 
 
 class TitleFooIndexModifier(object):
     """Test index modifier that check always Foo"""
-    
+
     implements(IParsedQueryIndexModifier)
-    
+
     def __call__(self, value):
         return ('Title', 'Foo')
 
@@ -27,9 +27,9 @@ class AbstractToDescriptionIndexModifier(object):
     Test index modifier that translate "Abstract" to Description index
     but where value do not count letter "e"
     """
-    
+
     implements(IParsedQueryIndexModifier)
-    
+
     def __call__(self, value):
         value['query'] = value['query'].replace('e', '')
         return ('Description', value)
diff --git a/plone/app/querystring/tests/registry_minimal_correct.xml b/plone/app/querystring/tests/registry_minimal_correct.xml
new file mode 100644
index 0000000..5d61538
--- /dev/null
+++ b/plone/app/querystring/tests/registry_minimal_correct.xml
@@ -0,0 +1,50 @@
+<registry>
+    <records interface="plone.app.querystring.interfaces.IQueryOperation"
+             prefix="plone.app.querystring.operation.string.is">
+        <value key="title">equals</value>
+        <value key="description">Tip: you can use * to autocomplete.</value>
+        <value key="operation">plone.app.querystring.queryparser:_equal</value>
+        <value key="widget"></value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryOperation"
+             prefix="plone.app.querystring.operation.date.lessThan">
+        <value key="title">before</value>
+        <value key="description">Please use YYYY/MM/DD.</value>
+        <value key="operation">plone.app.querystring.queryparser:_lessThan</value>
+        <value key="widget"></value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryOperation"
+             prefix="plone.app.querystring.operation.date.largerThan">
+        <value key="title">after</value>
+        <value key="description">Please use YYYY/MM/DD.</value>
+        <value key="operation">plone.app.querystring.queryparser:_largerThan</value>
+        <value key="widget"></value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryField"
+             prefix="plone.app.querystring.field.getId">
+       <value key="title">Short Name</value>
+       <value key="description">The short name of an item (used in the url)</value>
+       <value key="enabled">True</value>
+       <value key="sortable">True</value>
+       <value key="operations">
+            <element>plone.app.querystring.operation.string.is</element>
+       </value>
+       <value key="group">Metadata</value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryField"
+             prefix="plone.app.querystring.field.created">
+       <value key="title">Creation Date</value>
+       <value key="description">The time and date an item was created</value>
+       <value key="enabled">True</value>
+       <value key="sortable">False</value>
+       <value key="operations">
+           <element>plone.app.querystring.operation.date.lessThan</element>
+           <element>plone.app.querystring.operation.date.largerThan</element>
+       </value>
+       <value key="group">Dates</value>
+    </records>
+</registry>
\ No newline at end of file
diff --git a/plone/app/querystring/tests/registry_test_missing_operator.xml b/plone/app/querystring/tests/registry_test_missing_operator.xml
new file mode 100644
index 0000000..81de888
--- /dev/null
+++ b/plone/app/querystring/tests/registry_test_missing_operator.xml
@@ -0,0 +1,22 @@
+<registry>
+    <records interface="plone.app.querystring.interfaces.IQueryOperation"
+             prefix="plone.app.querystring.operation.date.lessThan">
+        <value key="title">before</value>
+        <value key="description">Please use YYYY/MM/DD.</value>
+        <value key="operation">plone.app.querystring.queryparser:_lessThan</value>
+        <value key="widget"></value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryField"
+             prefix="plone.app.querystring.field.created">
+       <value key="title">Creation Date</value>
+       <value key="description">The time and date an item was created</value>
+       <value key="enabled">True</value>
+       <value key="sortable">False</value>
+       <value key="operations">
+           <element>plone.app.querystring.operation.date.lessThan</element>
+           <element>plone.app.querystring.operation.date.largerThan</element>
+       </value>
+       <value key="group">Dates</value>
+    </records>
+</registry>
\ No newline at end of file
diff --git a/plone/app/querystring/tests/registry_test_vocabulary.xml b/plone/app/querystring/tests/registry_test_vocabulary.xml
new file mode 100644
index 0000000..6b0affa
--- /dev/null
+++ b/plone/app/querystring/tests/registry_test_vocabulary.xml
@@ -0,0 +1,22 @@
+<registry>
+    <records interface="plone.app.querystring.interfaces.IQueryOperation"
+             prefix="plone.app.querystring.operation.string.is">
+        <value key="title">equals</value>
+        <value key="description">Tip: you can use * to autocomplete.</value>
+        <value key="operation">plone.app.querystring.queryparser:_equal</value>
+        <value key="widget"></value>
+    </records>
+
+    <records interface="plone.app.querystring.interfaces.IQueryField"
+             prefix="plone.app.querystring.field.reviewState">
+        <value key="title">Review state</value>
+        <value key="description">An item's workflow state (e.g.published)</value>
+        <value key="enabled">True</value>
+        <value key="sortable">True</value>
+        <value key="operations">
+            <element>plone.app.querystring.operation.string.is</element>
+        </value>
+        <value key="vocabulary">plone.app.querystring.tests.testvocabulary</value>
+       <value key="group">Metadata</value>
+    </records>
+</registry>
\ No newline at end of file
diff --git a/plone/app/querystring/tests/registry_testdata.py b/plone/app/querystring/tests/registry_testdata.py
index dc62933..619033f 100644
--- a/plone/app/querystring/tests/registry_testdata.py
+++ b/plone/app/querystring/tests/registry_testdata.py
@@ -1,104 +1,74 @@
-parsed_correct = {'plone': {'app': {'querystring': {'field': {'getId': {'operations': ['plone.app.querystring.operation.string.is'], 'group': u'Metadata', 'description': u'The short name of an item (used in the url)', 'vocabulary': None, 'title': u'Short Name', 'enabled': True, 'sortable': True}, 'created': {'operations': ['plone.app.querystring.operation.date.lessThan', 'plone.app.querystring.operation.date.largerThan'], 'group': u'Dates', 'description': u'The time and date an item was created', 'vocabulary': None, 'title': u'Creation Date', 'enabled': True, 'sortable': False}}, 'operation': {'date': {'largerThan': {'widget': None, 'operation': u'plone.app.querystring.queryparser:_largerThan', 'description': u'Please use YYYY/MM/DD.', 'title': u'after'}, 'lessThan': {'widget': None, 'operation': u'plone.app.querystring.queryparser:_lessThan', 'description': u'Please use YYYY/MM/DD.', 'title': u'before'}}, 'string': {'is': {'widget': None, 'operation': u'plone.app.querystring.queryparser:_equal', 'description': u'Tip: you can use * to autocomplete.', 'title': u'equals'}}}}}}}
+# -*- coding: utf-8 -*-
+import os
 
-minimal_correct_xml = """
-<registry>
-    <records interface="plone.app.querystring.interfaces.IQueryOperation"
-             prefix="plone.app.querystring.operation.string.is">
-        <value key="title">equals</value>
-        <value key="description">Tip: you can use * to autocomplete.</value>
-        <value key="operation">plone.app.querystring.queryparser:_equal</value>
-        <value key="widget"></value>
-    </records>
+parsed_correct = {
+    'plone': {
+        'app': {
+            'querystring': {
+                'field': {
+                    'getId': {
+                        'operations': [
+                            'plone.app.querystring.operation.string.is'],
+                        'group': u'Metadata',
+                        'description': u'The short name of an item '
+                                       u'(used in the url)',
+                        'vocabulary': None,
+                        'title': u'Short Name',
+                        'enabled': True,
+                        'sortable': True
+                    },
+                    'created': {
+                        'operations': [
+                            'plone.app.querystring.operation.date.lessThan',
+                            'plone.app.querystring.operation.date.largerThan'
+                        ],
+                        'group': u'Dates',
+                        'description': u'The time and date an item was '
+                                       u'created',
+                        'vocabulary': None,
+                        'title': u'Creation Date',
+                        'enabled': True,
+                        'sortable': False
+                    }
+                },
+                'operation': {
+                    'date': {
+                        'largerThan': {
+                            'widget': None,
+                            'operation': u'plone.app.querystring.queryparser'
+                                         u':_largerThan',
+                            'description': u'Please use YYYY/MM/DD.',
+                            'title': u'after'
+                        },
+                        'lessThan': {
+                            'widget': None,
+                            'operation': u'plone.app.querystring.queryparser:'
+                                         u'_lessThan',
+                            'description': u'Please use YYYY/MM/DD.',
+                            'title': u'before'
+                        }
+                    },
+                    'string': {
+                        'is': {
+                            'widget': None,
+                            'operation': u'plone.app.querystring.queryparser:'
+                                         u'_equal',
+                            'description': u'Tip: you can use * to '
+                                           u'autocomplete.',
+                            'title': u'equals'
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
 
-    <records interface="plone.app.querystring.interfaces.IQueryOperation"
-             prefix="plone.app.querystring.operation.date.lessThan">
-        <value key="title">before</value>
-        <value key="description">Please use YYYY/MM/DD.</value>
-        <value key="operation">plone.app.querystring.queryparser:_lessThan</value>
-        <value key="widget"></value>
-    </records>
 
-    <records interface="plone.app.querystring.interfaces.IQueryOperation"
-             prefix="plone.app.querystring.operation.date.largerThan">
-        <value key="title">after</value>
-        <value key="description">Please use YYYY/MM/DD.</value>
-        <value key="operation">plone.app.querystring.queryparser:_largerThan</value>
-        <value key="widget"></value>
-    </records>
+def reg_load_xml(filename):
+    with open(os.path.join(os.path.dirname(__file__), filename)) as rx:
+        return rx.read()
 
-    <records interface="plone.app.querystring.interfaces.IQueryField"
-             prefix="plone.app.querystring.field.getId">
-       <value key="title">Short Name</value>
-       <value key="description">The short name of an item (used in the url)</value>
-       <value key="enabled">True</value>
-       <value key="sortable">True</value>
-       <value key="operations">
-            <element>plone.app.querystring.operation.string.is</element>
-       </value>
-       <value key="group">Metadata</value>
-    </records>
-
-    <records interface="plone.app.querystring.interfaces.IQueryField"
-             prefix="plone.app.querystring.field.created">
-       <value key="title">Creation Date</value>
-       <value key="description">The time and date an item was created</value>
-       <value key="enabled">True</value>
-       <value key="sortable">False</value>
-       <value key="operations">
-           <element>plone.app.querystring.operation.date.lessThan</element>
-           <element>plone.app.querystring.operation.date.largerThan</element>
-       </value>
-       <value key="group">Dates</value>
-    </records>
-</registry>
-"""
-
-test_missing_operator_xml = """
-<registry>
-    <records interface="plone.app.querystring.interfaces.IQueryOperation"
-             prefix="plone.app.querystring.operation.date.lessThan">
-        <value key="title">before</value>
-        <value key="description">Please use YYYY/MM/DD.</value>
-        <value key="operation">plone.app.querystring.queryparser:_lessThan</value>
-        <value key="widget"></value>
-    </records>
-
-    <records interface="plone.app.querystring.interfaces.IQueryField"
-             prefix="plone.app.querystring.field.created">
-       <value key="title">Creation Date</value>
-       <value key="description">The time and date an item was created</value>
-       <value key="enabled">True</value>
-       <value key="sortable">False</value>
-       <value key="operations">
-           <element>plone.app.querystring.operation.date.lessThan</element>
-           <element>plone.app.querystring.operation.date.largerThan</element>
-       </value>
-       <value key="group">Dates</value>
-    </records>
-</registry>
-"""
-
-test_vocabulary_xml = """
-<registry>
-    <records interface="plone.app.querystring.interfaces.IQueryOperation"
-             prefix="plone.app.querystring.operation.string.is">
-        <value key="title">equals</value>
-        <value key="description">Tip: you can use * to autocomplete.</value>
-        <value key="operation">plone.app.querystring.queryparser:_equal</value>
-        <value key="widget"></value>
-    </records>
-
-    <records interface="plone.app.querystring.interfaces.IQueryField"
-             prefix="plone.app.querystring.field.reviewState">
-        <value key="title">Review state</value>
-        <value key="description">An item's workflow state (e.g.published)</value>
-        <value key="enabled">True</value>
-        <value key="sortable">True</value>
-        <value key="operations">
-            <element>plone.app.querystring.operation.string.is</element>
-        </value>
-        <value key="vocabulary">plone.app.querystring.tests.testvocabulary</value>
-       <value key="group">Metadata</value>
-    </records>
-</registry>
-"""
+minimal_correct_xml = reg_load_xml('registry_minimal_correct.xml')
+test_missing_operator_xml = reg_load_xml('registry_test_missing_operator.xml')
+test_vocabulary_xml = reg_load_xml('registry_test_vocabulary.xml')
diff --git a/plone/app/querystring/tests/testQueryBuilder.py b/plone/app/querystring/tests/testQueryBuilder.py
index dace663..08236bf 100644
--- a/plone/app/querystring/tests/testQueryBuilder.py
+++ b/plone/app/querystring/tests/testQueryBuilder.py
@@ -17,8 +17,10 @@ def afterSetUp(self):
         self.testpage = testpage
         self.portal.portal_workflow.doActionFor(testpage, 'publish')
         self.request = TestRequest()
-        self.querybuilder = getMultiAdapter((self.portal, self.request),
-                                             name='querybuilderresults')
+        self.querybuilder = getMultiAdapter(
+            (self.portal, self.request),
+            name='querybuilderresults'
+        )
         self.query = [{
             'i': 'Title',
             'o': 'plone.app.querystring.operation.string.is',
diff --git a/plone/app/querystring/tests/testQueryBuilderModifiers.py b/plone/app/querystring/tests/testQueryBuilderModifiers.py
index 4072318..82bf0bb 100644
--- a/plone/app/querystring/tests/testQueryBuilderModifiers.py
+++ b/plone/app/querystring/tests/testQueryBuilderModifiers.py
@@ -32,12 +32,17 @@ def afterSetUp(self):
         testpage3 = self.portal['collectionstestpage3']
         self.portal.portal_workflow.doActionFor(testpage3, 'publish')
         self.request = TestRequest()
-        self.querybuilder = getMultiAdapter((self.portal, self.request),
-                                             name='querybuilderresults')
+        self.querybuilder = getMultiAdapter(
+            (self.portal, self.request),
+            name='querybuilderresults'
+        )
 
     def testModifierNotCalled(self):
         gsm = getGlobalSiteManager()
-        gsm.registerUtility(index_testmodifier.SimpleFooIndexModifier(), name=u'Foo')
+        gsm.registerUtility(
+            index_testmodifier.SimpleFooIndexModifier(),
+            name=u'Foo'
+        )
         query = [{
             'i': 'Title',
             'o': 'plone.app.querystring.operation.string.is',
@@ -54,7 +59,10 @@ def testModifierNotCalled(self):
 
     def testModifierChangeQuery(self):
         gsm = getGlobalSiteManager()
-        gsm.registerUtility(index_testmodifier.TitleFooIndexModifier(), name=u'Title')
+        gsm.registerUtility(
+            index_testmodifier.TitleFooIndexModifier(),
+            name=u'Title'
+        )
         query = [{
             'i': 'Title',
             'o': 'plone.app.querystring.operation.string.is',
@@ -64,11 +72,17 @@ def testModifierChangeQuery(self):
         results = self.querybuilder(query=query)
         self.assertEqual(len(results), 1)
         self.assertEqual(results[0].Title(), "Foo")
-        gsm.unregisterUtility(provided=IParsedQueryIndexModifier, name=u'Title')
+        gsm.unregisterUtility(
+            provided=IParsedQueryIndexModifier,
+            name=u'Title'
+        )
 
     def testModifierChangeQueryAndIndex(self):
         gsm = getGlobalSiteManager()
-        gsm.registerUtility(index_testmodifier.AbstractToDescriptionIndexModifier(), name=u'Abstract')
+        gsm.registerUtility(
+            index_testmodifier.AbstractToDescriptionIndexModifier(),
+            name=u'Abstract'
+        )
         query = [{
             'i': 'Abstract',
             'o': 'plone.app.querystring.operation.string.is',
@@ -78,4 +92,7 @@ def testModifierChangeQueryAndIndex(self):
         results = self.querybuilder(query=query)
         self.assertEqual(len(results), 1)
         self.assertEqual(results[0].Title(), "Bar")
-        gsm.unregisterUtility(provided=IParsedQueryIndexModifier, name=u'Abstract')
+        gsm.unregisterUtility(
+            provided=IParsedQueryIndexModifier,
+            name=u'Abstract'
+        )
diff --git a/plone/app/querystring/tests/testQueryParser.py b/plone/app/querystring/tests/testQueryParser.py
index 71ae8e3..376d2f0 100644
--- a/plone/app/querystring/tests/testQueryParser.py
+++ b/plone/app/querystring/tests/testQueryParser.py
@@ -209,35 +209,43 @@ def test_multi_path_with_depth_computet(self):
 class TestQueryGenerators(TestQueryParserBase):
 
     def test__between(self):
-        data = Row(index='modified',
-                  operator='_between',
-                  values=['2009/08/12', '2009/08/14'])
+        data = Row(
+            index='modified',
+            operator='_between',
+            values=['2009/08/12', '2009/08/14']
+        )
         parsed = queryparser._between(MockSite(), data)
         expected = {'modified': {'query': ['2009/08/12', '2009/08/14'],
                     'range': 'minmax'}}
         self.assertEqual(parsed, expected)
 
     def test__between_reversed_dates(self):
-        data = Row(index='modified',
-                  operator='_between',
-                  values=['2009/08/14', '2009/08/12'])
+        data = Row(
+            index='modified',
+            operator='_between',
+            values=['2009/08/14', '2009/08/12']
+        )
         parsed = queryparser._between(MockSite(), data)
         expected = {'modified': {'query': ['2009/08/12', '2009/08/14'],
                     'range': 'minmax'}}
         self.assertEqual(parsed, expected)
 
     def test__largerThan(self):
-        data = Row(index='modified',
-                  operator='_largerThan',
-                  values='2010/03/18')
+        data = Row(
+            index='modified',
+            operator='_largerThan',
+            values='2010/03/18'
+        )
         parsed = queryparser._largerThan(MockSite(), data)
         expected = {'modified': {'query': '2010/03/18', 'range': 'min'}}
         self.assertEqual(parsed, expected)
 
     def test__lessThan(self):
-        data = Row(index='modified',
-                  operator='_lessThan',
-                  values='2010/03/18')
+        data = Row(
+            index='modified',
+            operator='_lessThan',
+            values='2010/03/18'
+        )
         parsed = queryparser._lessThan(MockSite(), data)
         expected = {'modified': {'query': '2010/03/18', 'range': 'max'}}
         self.assertEqual(parsed, expected)
@@ -247,9 +255,11 @@ def test__currentUser(self):
         u = MockUser()
         pm = MockPortal_membership(user=u)
         context = MockSite(portal_membership=pm)
-        data = Row(index='Creator',
-                  operator='_currentUser',
-                  values=None)
+        data = Row(
+            index='Creator',
+            operator='_currentUser',
+            values=None
+        )
         parsed = queryparser._currentUser(context, data)
         expected = {'Creator': {'query': 'Anonymous User'}}
         self.assertEqual(parsed, expected)
@@ -258,9 +268,11 @@ def test__currentUser(self):
         u = MockUser(username='admin')
         pm = MockPortal_membership(user=u)
         context = MockSite(portal_membership=pm)
-        data = Row(index='Creator',
-                  operator='_currentUser',
-                  values=None)
+        data = Row(
+            index='Creator',
+            operator='_currentUser',
+            values=None
+        )
         parsed = queryparser._currentUser(context, data)
         expected = {'Creator': {'query': 'admin'}}
         self.assertEqual(parsed, expected)
@@ -271,9 +283,11 @@ def test__lessThanRelativeDate(self):
         mydate = now + days
         expected_dates = [now.earliestTime(), mydate.latestTime()]
         expected = {'modified': {'query': expected_dates, 'range': 'minmax'}}
-        data = Row(index='modified',
-                  operator='_lessThanRelativeDate',
-                  values=days)
+        data = Row(
+            index='modified',
+            operator='_lessThanRelativeDate',
+            values=days
+        )
         parsed = queryparser._lessThanRelativeDate(MockSite(), data)
         self.assertEqual(parsed, expected)
 
@@ -283,9 +297,11 @@ def test__moreThanRelativeDate(self):
         mydate = now - days
         expected_dates = [mydate.earliestTime(), now.latestTime()]
         expected = {'modified': {'query': expected_dates, 'range': 'minmax'}}
-        data = Row(index='modified',
-                  operator='_moreThanRelativeDate',
-                  values=days)
+        data = Row(
+            index='modified',
+            operator='_moreThanRelativeDate',
+            values=days
+        )
         parsed = queryparser._moreThanRelativeDate(MockSite(), data)
         self.assertEqual(parsed, expected)
 
@@ -293,25 +309,31 @@ def test__today(self):
         now = DateTime()
         expected_dates = [now.earliestTime(), now.latestTime()]
         expected = {'modified': {'query': expected_dates, 'range': 'minmax'}}
-        data = Row(index='modified',
-                  operator='_today',
-                  values=expected_dates)
+        data = Row(
+            index='modified',
+            operator='_today',
+            values=expected_dates
+        )
         parsed = queryparser._today(MockSite(), data)
         self.assertEqual(parsed, expected)
 
     def test__path(self):
         # normal path
-        data = Row(index='path',
-                  operator='_path',
-                  values='/news/')
+        data = Row(
+            index='path',
+            operator='_path',
+            values='/news/'
+        )
         parsed = queryparser._path(MockSite(), data)
         expected = {'path': {'query': ['/%s/news/' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # by uid
-        data = Row(index='path',
-                  operator='_path',
-                  values='00000000000000001')
+        data = Row(
+            index='path',
+            operator='_path',
+            values='00000000000000001'
+        )
         parsed = queryparser._path(MockSite(), data)
         expected = {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
@@ -336,25 +358,29 @@ def test__relativePath(self):
                                             path="/%s/bar/egg" % MOCK_SITE_ID)
 
         # show my siblings
-        data = Row(index='path',
-                  operator='_relativePath',
-                  values='..')
+        data = Row(
+            index='path',
+            operator='_relativePath',
+            values='..'
+        )
         parsed = queryparser._relativePath(context, data)
         expected = {'path': {'query': ['/%s/bar' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # walk upwards
-        data = Row(index='path',
-                  operator='_relativePath',
-                  values='../../')
+        data = Row(
+            index='path',
+            operator='_relativePath',
+            values='../../'
+        )
         parsed = queryparser._relativePath(context, data)
         expected = {'path': {'query': ['/%s' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
 
         # if you walk beyond INavigatinRoot it should stop and return
         data = Row(index='path',
-                  operator='_relativePath',
-                  values='../../../')
+                   operator='_relativePath',
+                   values='../../../')
         parsed = queryparser._relativePath(context, data)
         expected = {'path': {'query': ['/%s' % MOCK_SITE_ID]}}
         self.assertEqual(parsed, expected)
diff --git a/plone/app/querystring/tests/testRegistryIntegration.py b/plone/app/querystring/tests/testRegistryIntegration.py
index e17369d..9cd9247 100644
--- a/plone/app/querystring/tests/testRegistryIntegration.py
+++ b/plone/app/querystring/tests/testRegistryIntegration.py
@@ -66,4 +66,3 @@ def test_getobjpositioninparent_largerthan(self):
         # check if operation is used for getObjPositionInParent
         operations = registry.get(key)
         self.assertTrue(operation in operations)
-
diff --git a/plone/app/querystring/tests/testRegistryReader.py b/plone/app/querystring/tests/testRegistryReader.py
index d15ff69..6d621fb 100644
--- a/plone/app/querystring/tests/testRegistryReader.py
+++ b/plone/app/querystring/tests/testRegistryReader.py
@@ -98,10 +98,14 @@ def test_map_operations_missing(self):
         result = reader.mapOperations(result)
         operators = result.get(
             'plone.app.querystring.field.created.operators').keys()
-        self.assertTrue('plone.app.querystring.operation.date.lessThan'
-            in operators)
-        self.assertFalse('plone.app.querystring.operation.date.largerThan'
-            in operators)
+        self.assertTrue(
+            'plone.app.querystring.operation.date.lessThan'
+            in operators
+        )
+        self.assertFalse(
+            'plone.app.querystring.operation.date.largerThan'
+            in operators
+        )
 
     def test_sortable_indexes(self):
         """tests if sortable indexes from the registry will be available in
diff --git a/setup.py b/setup.py
index a0c6689..5c30562 100644
--- a/setup.py
+++ b/setup.py
@@ -2,54 +2,57 @@
 
 version = '1.2.0.dev0'
 
-setup(name='plone.app.querystring',
-      version=version,
-      description="",
-      long_description=open("README.rst").read() + "\n" +
-                       open("CHANGES.rst").read(),
-      classifiers=[
+long_description = open("README.rst").read() + "\n"
+long_description += open("CHANGES.rst").read()
+
+setup(
+    name='plone.app.querystring',
+    version=version,
+    description="",
+    long_description=long_description,
+    classifiers=[
         "Framework :: Plone",
         "License :: OSI Approved :: GNU General Public License (GPL)",
         "Programming Language :: Python",
-        ],
-      keywords='',
-      author='Plone Foundation',
-      author_email='plone-developers at lists.sourceforge.net',
-      url='http://pypi.python.org/pypi/plone.app.querystring',
-      license='GPL version 2',
-      packages=find_packages(exclude=['ez_setup']),
-      namespace_packages=['plone', 'plone.app'],
-      include_package_data=True,
-      zip_safe=False,
-      install_requires=[
-          'setuptools',
-          'DateTime',
-          'Products.CMFCore',
-          'Products.CMFPlone',
-          'plone.app.contentlisting',
-          'plone.app.layout',
-          'plone.app.registry>=1.1dev',
-          'plone.app.upgrades',
-          'plone.app.vocabularies',
-          'plone.batching',
-          'plone.registry',
-          'zope.component',
-          'zope.dottedname',
-          'zope.globalrequest',
-          'zope.i18n',
-          'zope.i18nmessageid',
-          'zope.interface',
-          'zope.publisher',
-          'zope.schema',
-      ],
-      extras_require={
-          'test': [
-              'collective.testcaselayer',
-              'Products.PloneTestCase',
-          ]
-      },
-      entry_points="""
-      [z3c.autoinclude.plugin]
-      target = plone
-      """,
-      )
+    ],
+    keywords='',
+    author='Plone Foundation',
+    author_email='plone-developers at lists.sourceforge.net',
+    url='http://pypi.python.org/pypi/plone.app.querystring',
+    license='GPL version 2',
+    packages=find_packages(exclude=['ez_setup']),
+    namespace_packages=['plone', 'plone.app'],
+    include_package_data=True,
+    zip_safe=False,
+    install_requires=[
+        'DateTime',
+        'Products.CMFCore',
+        'Products.CMFPlone',
+        'plone.app.contentlisting',
+        'plone.app.layout',
+        'plone.app.registry>=1.1dev',
+        'plone.app.upgrades',
+        'plone.app.vocabularies',
+        'plone.batching',
+        'plone.registry',
+        'setuptools',
+        'zope.component',
+        'zope.dottedname',
+        'zope.globalrequest',
+        'zope.i18n',
+        'zope.i18nmessageid',
+        'zope.interface',
+        'zope.publisher',
+        'zope.schema',
+    ],
+    extras_require={
+        'test': [
+            'collective.testcaselayer',
+            'Products.PloneTestCase',
+        ]
+    },
+    entry_points="""
+    [z3c.autoinclude.plugin]
+    target = plone
+    """,
+)




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 65649 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140403/01675cd3/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 11765 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140403/01675cd3/attachment-0003.obj>


More information about the Testbot mailing list