diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_collection.py | 12 |
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): |