ntype -> note

This commit is contained in:
Damien Elmes 2012-04-07 13:53:55 +09:00
parent 2ba5f80cf1
commit 2f75e99671
2 changed files with 4 additions and 4 deletions

View file

@ -349,7 +349,7 @@ n.mid in %s and n.id %s in %s""" % (
elif token['value'].startswith("is:"): elif token['value'].startswith("is:"):
token['value'] = token['value'][3:].lower() token['value'] = token['value'][3:].lower()
type = SEARCH_TYPE type = SEARCH_TYPE
elif token['value'].startswith("ntype:"): elif token['value'].startswith("note:"):
token['value'] = token['value'][6:].lower() token['value'] = token['value'][6:].lower()
type = SEARCH_MODEL type = SEARCH_MODEL
elif token['value'].startswith("deck:"): elif token['value'].startswith("deck:"):

View file

@ -101,9 +101,9 @@ def test_findCards():
deck.conf['sortBackwards'] = True deck.conf['sortBackwards'] = True
assert deck.findCards("")[0] in latestCardIds assert deck.findCards("")[0] in latestCardIds
# model # model
assert len(deck.findCards("ntype:basic")) == 5 assert len(deck.findCards("note:basic")) == 5
assert len(deck.findCards("-ntype:basic")) == 0 assert len(deck.findCards("-note:basic")) == 0
assert len(deck.findCards("-ntype:foo")) == 5 assert len(deck.findCards("-note:foo")) == 5
# deck # deck
assert len(deck.findCards("deck:default")) == 5 assert len(deck.findCards("deck:default")) == 5
assert len(deck.findCards("-deck:default")) == 0 assert len(deck.findCards("-deck:default")) == 0