Adjusts tests to pass new template checks

This commit is contained in:
RumovZ 2021-05-28 10:08:55 +02:00
parent 2e923db6bd
commit c6e78e6f21
2 changed files with 2 additions and 5 deletions

View file

@ -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():

View file

@ -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", []]