Commits

Matt Chaput  committed 05a2c4b

Convert parsed boolean strings to lowercase before comparing. Fixes issue #243.

  • Participants
  • Parent commits 84c3302

Comments (0)

Files changed (2)

File src/whoosh/fields.py

 
     def to_text(self, bit):
         if isinstance(bit, string_type):
-            bit = bit in self.trues
+            bit = bit.lower() in self.trues
         elif not isinstance(bit, bool):
             raise ValueError("%r is not a boolean")
         return self.strings[int(bit)]

File tests/test_parsing.py

                  "time:*Ben-Hayden*)")
 
 
+def test_bool_True():
+    schema = fields.Schema(text=fields.TEXT, bool=fields.BOOLEAN)
+    qp = default.QueryParser("text", schema)
+    q = qp.parse("bool:True")
+    assert_equal(q.__class__, query.Term)
+    assert_equal(q.fieldname, "bool")
+    assert_equal(q.text, "t")
 
 
 
 
 
 
+