[Testbot] Plone 4.3 - Python 2.7 - Build # 2865 - Fixed! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Sun Feb 1 15:33:33 UTC 2015


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.7 - Build # 2865 - Fixed!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.7/2865/


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

Repository: plone.batching
Branch: refs/heads/master
Date: 2015-01-31T02:53:51+01:00
Author: Daniel Widerin (saily) <daniel at widerin.net>
Commit: https://github.com/plone/plone.batching/commit/6fc1df86fa2c5202a3713120ee65569349239184

Revert "Fix issue with orphaning"

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

diff --git a/CHANGES.rst b/CHANGES.rst
index 420d228..a2eb2dc 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,8 +4,7 @@ Changelog
 1.0.3 (unreleased)
 ------------------
 
-- Fix issue with orphaning
-  [do3cc]
+- Nothing changed yet.
 
 
 1.0.2 (2014-04-13)
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index f6d3e87..c5e57d0 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -31,8 +31,6 @@ def __init__(self, sequence, size, start=0, end=0, orphan=0, overlap=0,
         overlap   - the number of overlapping elements in each batch
         pagerange - the number of pages to display in the navigation
         """
-        assert orphan < size, "Having an orphan size, higher than batch size" \
-                              " is undefined"
         start += 1
         self._sequence = sequence
         self._size = size
@@ -157,7 +155,7 @@ def lastpage(self):
         """ Last page of batch
         """
         pages = self.sequence_length / self.pagesize
-        if (self.sequence_length - self.orphan) % self.pagesize:
+        if self.sequence_length % self.pagesize:
             pages += 1
         return pages
 
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index 5b92a44..3b442cc 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -97,13 +97,6 @@ def test_lastpage(self):
         lastbatch = BaseBatch(range(20), 5, start=batch.last)
         self.assertTrue(lastbatch.islastpage)
 
-    def test_lastpage_with_orphans(self):
-        batch = BaseBatch(range(11), 10, orphan=1)
-        self.assertEqual(1, batch.lastpage)
-        batch = BaseBatch(range(109), 10, orphan=9)
-        self.assertEqual(10, batch.lastpage)
-        self.assertRaises(AssertionError, BaseBatch, [], 10, orphan=20)
-
     def test_items_not_on_page(self):
         batch = BaseBatch(range(20), 5, start=5)
         self.assertEqual(batch.items_not_on_page,


Repository: plone.batching
Branch: refs/heads/master
Date: 2015-02-01T16:02:53+01:00
Author: Timo Stollenwerk (tisto) <tisto at plone.org>
Commit: https://github.com/plone/plone.batching/commit/3f388e3d81904a0efab9843f857883e3bd281571

Merge pull request #5 from plone/revert-4-orphaning

Revert "Fix issue with orphaning"

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

diff --git a/CHANGES.rst b/CHANGES.rst
index 420d228..a2eb2dc 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,8 +4,7 @@ Changelog
 1.0.3 (unreleased)
 ------------------
 
-- Fix issue with orphaning
-  [do3cc]
+- Nothing changed yet.
 
 
 1.0.2 (2014-04-13)
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index f6d3e87..c5e57d0 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -31,8 +31,6 @@ def __init__(self, sequence, size, start=0, end=0, orphan=0, overlap=0,
         overlap   - the number of overlapping elements in each batch
         pagerange - the number of pages to display in the navigation
         """
-        assert orphan < size, "Having an orphan size, higher than batch size" \
-                              " is undefined"
         start += 1
         self._sequence = sequence
         self._size = size
@@ -157,7 +155,7 @@ def lastpage(self):
         """ Last page of batch
         """
         pages = self.sequence_length / self.pagesize
-        if (self.sequence_length - self.orphan) % self.pagesize:
+        if self.sequence_length % self.pagesize:
             pages += 1
         return pages
 
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index 5b92a44..3b442cc 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -97,13 +97,6 @@ def test_lastpage(self):
         lastbatch = BaseBatch(range(20), 5, start=batch.last)
         self.assertTrue(lastbatch.islastpage)
 
-    def test_lastpage_with_orphans(self):
-        batch = BaseBatch(range(11), 10, orphan=1)
-        self.assertEqual(1, batch.lastpage)
-        batch = BaseBatch(range(109), 10, orphan=9)
-        self.assertEqual(10, batch.lastpage)
-        self.assertRaises(AssertionError, BaseBatch, [], 10, orphan=20)
-
     def test_items_not_on_page(self):
         batch = BaseBatch(range(20), 5, start=5)
         self.assertEqual(batch.items_not_on_page,




-------------------------------------------------------------------------------


More information about the Testbot mailing list