mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
add test
This commit is contained in:
parent
e506446224
commit
61664762f3
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,7 @@ def test_find_cards():
|
||||||
note = col.newNote()
|
note = col.newNote()
|
||||||
note["Front"] = "cat"
|
note["Front"] = "cat"
|
||||||
note["Back"] = "sheep"
|
note["Back"] = "sheep"
|
||||||
|
note.tags.append("conjunção größte")
|
||||||
col.addNote(note)
|
col.addNote(note)
|
||||||
catCard = note.cards()[0]
|
catCard = note.cards()[0]
|
||||||
m = col.models.current()
|
m = col.models.current()
|
||||||
|
@ -68,6 +69,8 @@ def test_find_cards():
|
||||||
col.tags.bulk_remove(col.db.list("select id from notes"), "foo")
|
col.tags.bulk_remove(col.db.list("select id from notes"), "foo")
|
||||||
assert len(col.find_cards("tag:foo")) == 0
|
assert len(col.find_cards("tag:foo")) == 0
|
||||||
assert len(col.find_cards("tag:bar")) == 5
|
assert len(col.find_cards("tag:bar")) == 5
|
||||||
|
assert len(col.find_cards("tag:conjuncao tag:groste")) == 0
|
||||||
|
assert len(col.find_cards("tag:nc:conjuncao tag:nc:groste")) == 1
|
||||||
# text searches
|
# text searches
|
||||||
assert len(col.find_cards("cat")) == 2
|
assert len(col.find_cards("cat")) == 2
|
||||||
assert len(col.find_cards("cat -dog")) == 1
|
assert len(col.find_cards("cat -dog")) == 1
|
||||||
|
|
Loading…
Reference in a new issue