mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Adjusts tests to pass new template checks
This commit is contained in:
parent
2e923db6bd
commit
c6e78e6f21
2 changed files with 2 additions and 5 deletions
|
@ -143,10 +143,6 @@ def test_furigana():
|
||||||
n["Front"] = "foo[sound:abc.mp3]"
|
n["Front"] = "foo[sound:abc.mp3]"
|
||||||
n.flush()
|
n.flush()
|
||||||
assert "anki:play" in c.q(reload=True)
|
assert "anki:play" in c.q(reload=True)
|
||||||
# it shouldn't throw an error while people are editing
|
|
||||||
m["tmpls"][0]["qfmt"] = "{{kana:}}"
|
|
||||||
mm.save(m)
|
|
||||||
c.q(reload=True)
|
|
||||||
|
|
||||||
|
|
||||||
def test_translate():
|
def test_translate():
|
||||||
|
|
|
@ -115,6 +115,7 @@ def test_templates():
|
||||||
assert stripHTML(c.q()) == "1"
|
assert stripHTML(c.q()) == "1"
|
||||||
# it shouldn't be possible to orphan notes by removing templates
|
# it shouldn't be possible to orphan notes by removing templates
|
||||||
t = mm.newTemplate("template name")
|
t = mm.newTemplate("template name")
|
||||||
|
t["qfmt"] = "{{Front}}2"
|
||||||
mm.addTemplate(m, t)
|
mm.addTemplate(m, t)
|
||||||
col.models.remTemplate(m, m["tmpls"][0])
|
col.models.remTemplate(m, m["tmpls"][0])
|
||||||
assert (
|
assert (
|
||||||
|
@ -391,7 +392,7 @@ def test_req():
|
||||||
mm.save(opt, templates=True)
|
mm.save(opt, templates=True)
|
||||||
assert opt["req"][1] == [1, "any", [1, 2]]
|
assert opt["req"][1] == [1, "any", [1, 2]]
|
||||||
# testing None
|
# testing None
|
||||||
opt["tmpls"][1]["qfmt"] = "{{^Add Reverse}}{{/Add Reverse}}"
|
opt["tmpls"][1]["qfmt"] = "{{^Add Reverse}}{{Tags}}{{/Add Reverse}}"
|
||||||
mm.save(opt, templates=True)
|
mm.save(opt, templates=True)
|
||||||
assert opt["req"][1] == [1, "none", []]
|
assert opt["req"][1] == [1, "none", []]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue