less terse card state searches

This commit is contained in:
Damien Elmes 2011-11-28 20:18:16 +09:00
parent 67e4f0d1cc
commit 8c1266ab2a
2 changed files with 4 additions and 4 deletions

View file

@ -131,8 +131,8 @@ and c.nid=n.id %s""" % (q, order)
def _findCardState(self, val, neg):
cond = None
if val in ("rev", "new", "lrn"):
if val == "rev":
if val in ("review", "new", "learn"):
if val == "review":
n = 2
elif val == "new":
n = 0

View file

@ -58,9 +58,9 @@ def test_findCards():
# card states
c = f.cards()[0]
c.type = 2
assert deck.findCards("is:rev") == []
assert deck.findCards("is:review") == []
c.flush()
assert deck.findCards("is:rev") == [c.id]
assert deck.findCards("is:review") == [c.id]
assert deck.findCards("is:due") == []
c.due = 0; c.queue = 2
c.flush()