From b1877db882ff681cc7061eab5ef6ff418d265629 Mon Sep 17 00:00:00 2001 From: David Sauve Date: Tue, 10 Nov 2009 21:53:32 -0500 Subject: [PATCH] Six passing tests. Combining AND, OR, NOT works. --- tests/xapian_tests/tests/xapian_query.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/xapian_tests/tests/xapian_query.py b/tests/xapian_tests/tests/xapian_query.py index 189881f..1578829 100644 --- a/tests/xapian_tests/tests/xapian_query.py +++ b/tests/xapian_tests/tests/xapian_query.py @@ -70,12 +70,11 @@ class XapianSearchQueryTestCase(TestCase): self.sq.add_filter(SQ(content='hello') | SQ(content='world')) self.assertEqual(self.sq.build_query().get_description(), 'Xapian::Query((hello OR world))') - # def test_build_query_multiple_words_mixed(self): - # self.sq.add_filter('content', 'why') - # self.sq.add_filter('content', 'hello', use_or=True) - # self.sq.add_filter('content', 'world', use_not=True) - # self.assertEqual(self.sq.build_query(), 'why OR hello NOT world') - # + def test_build_query_multiple_words_mixed(self): + self.sq.add_filter(SQ(content='why') | SQ(content='hello')) + self.sq.add_filter(~SQ(content='world')) + self.assertEqual(self.sq.build_query().get_description(), 'Xapian::Query(((why OR hello) AND ( AND_NOT world)))') + # def test_build_query_phrase(self): # self.sq.add_filter('content', 'hello world') # self.assertEqual(self.sq.build_query(), '"hello world"')