aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-03 15:17:05 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-02-03 15:17:05 +0100
commit61d154920d158767dc2b29bf9239f74d0dcdc751 (patch)
treea1f1d843ce5501dd2dfa994bf3bfcdd3d8166499 /tests
parent23de3297bbd74980a2f6da326acc5da63ddef2fe (diff)
Allow to get a sorted list of all entries
Diffstat (limited to 'tests')
-rw-r--r--tests/test_collection.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index 4c95c2b..1e37589 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -391,6 +391,18 @@ class testComplexCollection(unittest.TestCase):
self.assertEqual(matches[2].data['order'], 'charlie')
self.assertEqual(matches[3].data['order'], 'zucchini')
+ def test_search_all_documents_default_sort(self):
+ self.collection.start_search('*')
+ res = self.collection.get_search_results()
+ matches = list(res)
+ self.assertEqual(len(matches), 9)
+ for i in range(5):
+ self.assertEqual(matches[i].data['order'], None)
+ self.assertEqual(matches[5].data['order'], 'alpha')
+ self.assertEqual(matches[6].data['order'], 'charlie')
+ self.assertEqual(matches[7].data['order'], 'delta')
+ self.assertEqual(matches[8].data['order'], 'zucchini')
+
class testCollectionWithErrors(unittest.TestCase):
def setUp(self):