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

jenkins at plone.org jenkins at plone.org
Tue Mar 11 16:25:51 UTC 2014


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

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


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

Repository: plone.batching
Branch: refs/heads/master
Date: 2014-03-11T16:48:48+01:00
Author: Gaudenz Steinlin (gaudenz) <gaudenz at soziologie.ch>
Commit: https://github.com/plone/plone.batching/commit/19c2af8885638b19fc741c6ae0c98ea4d4178739

Fix multiple_pages for sequence_lenght==pagesize

The previous test was obscure and wrong for the case where
sequence_lenght==pagesize.

Files changed:
M CHANGES.rst
M plone/batching/batch.py
M plone/batching/tests.py

diff --git a/CHANGES.rst b/CHANGES.rst
index ac9a5fe..c62c87d 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,9 @@ Changelog
   https://dev.plone.org/ticket/13880\
   [thepjot]
 
+- Fix multiple_pages if the length of the sequence is exactly the
+  page length.
+  [gaudenz]
 
 1.0.1 (2014-01-27)
 ------------------
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index 167e0e6..c5e57d0 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -175,7 +175,7 @@ def items_on_page(self):
     def multiple_pages(self):
         """ `True`, if batch has more than one page.
         """
-        return bool(self.sequence_length / self.pagesize)
+        return self.sequence_length > self.pagesize
 
     @property
     def previouspage(self):
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index 2988c2d..6812ef9 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -132,6 +132,20 @@ def test_batch_bsize(self):
         batch = BaseBatch.fromPagenumber(small_sequence, 2, 2)
         self.assertEqual(batch.length, 1)        
 
+    def test_multiple_pages_smaller(self):
+        """sequence smaller than batchsize"""
+        batch = BaseBatch(range(12), 20)
+        self.assertEquals(batch.multiple_pages, False)
+
+    def test_multiple_pages_equals(self):
+        """sequence equals batchsize"""
+        batch = BaseBatch(range(12), 12)
+        self.assertEquals(batch.multiple_pages, False)
+
+    def test_multiple_pages_longer(self):
+        """sequence longer than batchsize"""
+        batch = BaseBatch(range(12), 10)
+        self.assertEquals(batch.multiple_pages, True)
 
 
 class TestQuantumBatch(unittest.TestCase):




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


More information about the Testbot mailing list