Created
July 8, 2015 12:26
-
-
Save JayH5/934af6443a8ccfe59eb4 to your computer and use it in GitHub Desktop.
Test for page length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Manager.calls_manager | |
def test_index_keys_page_length(self): | |
indexed_model = self.manager.proxy(IndexedModel) | |
yield indexed_model("foo1", a=1, b=u"one").save() | |
yield indexed_model("foo2", a=1, b=u"one").save() | |
yield indexed_model("foo3", a=1, b=None).save() | |
keys1 = yield indexed_model.index_keys_page('a', 1, max_results=2) | |
self.assertEqual(len(keys1), 2) | |
keys2 = yield keys1.next_page() | |
self.assertEqual(len(keys2), 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment