Skip to content

Commit

Permalink
Revert "Merge pull request #1 from plone/fix-13880"
Browse files Browse the repository at this point in the history
This reverts commit 1d8abf8, reversing
changes made to 18b5a8a.
  • Loading branch information
davisagli committed Mar 9, 2014
1 parent 1d8abf8 commit c6ecc03
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
4 changes: 1 addition & 3 deletions CHANGES.rst
Expand Up @@ -4,9 +4,7 @@ Changelog
1.0.2 (unreleased)
------------------

- Fix issue where a start >= end will always return last item.
https://dev.plone.org/ticket/13880\
[thepjot]
- Nothing changed yet.


1.0.1 (2014-01-27)
Expand Down
2 changes: 0 additions & 2 deletions plone/batching/batch.py
Expand Up @@ -51,8 +51,6 @@ def initialize(self, start, end, size):
self.end = end

self.first = max(start - 1, 0)
if self.start == self.end and self.sequence_length > 1:
self.first = self.end
self.length = self.end - self.first

self.last = self.sequence_length - size
Expand Down
19 changes: 0 additions & 19 deletions plone/batching/tests.py
Expand Up @@ -104,25 +104,6 @@ def test_items_not_on_page(self):
self.assertEqual(list(batch), [5, 6, 7, 8, 9])


def test_batch_bsize(self):
sequence = range(279)
# Random page
batch = BaseBatch(sequence, 10, start=80)
self.assertEqual(batch.length, 10)

# Last page
batch = BaseBatch(sequence, 10, start=270)
self.assertEqual(batch.length, 9)

# Beyond last page
batch = BaseBatch(sequence, 10, start=280)
self.assertEqual(batch.length, 0)

# Single item batch
batch = BaseBatch(sequence[0:1], 10)
self.assertEqual(batch.length, 1)


class TestQuantumBatch(unittest.TestCase):

def test_quantumbatch(self):
Expand Down

1 comment on commit c6ecc03

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TESTS FAILED
Mr.roboto url : http://jenkins.plone.org/roboto/get_info?push=d47ae2900ef74f479c8142d53cf61b90
plone-4.3-python-2.6 [FAILURE]
plone-4.3-python-2.7 [FAILURE]
plone-5.0-python-2.7 [FAILURE]

Please sign in to comment.