Commits

Scott Wilson committed 706d354

Fixes a bug in the ignore_invalid_terms Schema flag.

Comments (0)

Files changed (2)

tests/test_memo.py

 def test_long_term():
     m = Memo()
     assert_raises(InvalidTermError, m.add_term, " " * 250)
+
+
+class LongOne(Schema):
+    ignore_invalid_terms = True
+    s1 = String.named('s1')
+
+
+def test_ignore_invalid():
+    s = LongOne.from_defaults()
+    f = Object(s1='s1' * 250)
+    s.update_by_object(f)
+    d = s.memo.dict
+    assert not d['terms']
                 else:
                     raise TypeError("Unknown element %s" % el)
 
+                value = None
                 try:
                     value = handler(el)
                 except InvalidTermError, e: