From d9665cab55078aa6e0c6ca4dce4a2c7ea8c4177d Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 24 Dec 2021 10:16:36 +0100 Subject: Add support for search_aliases in the settings file. Refs: https://todo.sr.ht/~valhalla/lesana/11 --- tests/test_collection.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/test_collection.py') diff --git a/tests/test_collection.py b/tests/test_collection.py index de349ed..1400f57 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -550,6 +550,18 @@ class testComplexCollection(unittest.TestCase): entry = self.collection.entry_from_eid(eid) self.assertEqual(entry.data['price'], "1.90") + def test_search_aliases(self): + search_query = "{{ nice }}" + search_query = self.collection.render_query_template(search_query) + print("QUERY IS", search_query) + self.collection.start_search(search_query) + res = self.collection.get_search_results() + matches = list(res) + self.assertEqual(len(matches), 2) + matches_ids = [m.eid for m in matches] + self.assertIn('8e9fa1ed3c1b4a30a6be7a98eda0cfa7', matches_ids) + self.assertIn('5084bc6e94f24dc6976629282ef30419', matches_ids) + class testCollectionWithErrors(unittest.TestCase): def setUp(self): -- cgit v1.2.3