mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
less terse card state searches
This commit is contained in:
parent
67e4f0d1cc
commit
8c1266ab2a
2 changed files with 4 additions and 4 deletions
|
@ -131,8 +131,8 @@ and c.nid=n.id %s""" % (q, order)
|
||||||
|
|
||||||
def _findCardState(self, val, neg):
|
def _findCardState(self, val, neg):
|
||||||
cond = None
|
cond = None
|
||||||
if val in ("rev", "new", "lrn"):
|
if val in ("review", "new", "learn"):
|
||||||
if val == "rev":
|
if val == "review":
|
||||||
n = 2
|
n = 2
|
||||||
elif val == "new":
|
elif val == "new":
|
||||||
n = 0
|
n = 0
|
||||||
|
|
|
@ -58,9 +58,9 @@ def test_findCards():
|
||||||
# card states
|
# card states
|
||||||
c = f.cards()[0]
|
c = f.cards()[0]
|
||||||
c.type = 2
|
c.type = 2
|
||||||
assert deck.findCards("is:rev") == []
|
assert deck.findCards("is:review") == []
|
||||||
c.flush()
|
c.flush()
|
||||||
assert deck.findCards("is:rev") == [c.id]
|
assert deck.findCards("is:review") == [c.id]
|
||||||
assert deck.findCards("is:due") == []
|
assert deck.findCards("is:due") == []
|
||||||
c.due = 0; c.queue = 2
|
c.due = 0; c.queue = 2
|
||||||
c.flush()
|
c.flush()
|
||||||
|
|
Loading…
Reference in a new issue