mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
replace "note" by "field"
My bad. In one case `f` did represent "field" and not "fact"
This commit is contained in:
parent
f04ea6904d
commit
bff784dc9a
1 changed files with 6 additions and 6 deletions
|
@ -44,13 +44,13 @@ def test_fields():
|
||||||
assert "{{NewFront}}" in m["tmpls"][0]["qfmt"]
|
assert "{{NewFront}}" in m["tmpls"][0]["qfmt"]
|
||||||
h = col.models.scmhash(m)
|
h = col.models.scmhash(m)
|
||||||
# add a field
|
# add a field
|
||||||
note = col.models.newField("foo")
|
field = col.models.newField("foo")
|
||||||
col.models.addField(m, note)
|
col.models.addField(m, field)
|
||||||
assert col.getNote(col.models.nids(m)[0]).fields == ["1", "2", ""]
|
assert col.getNote(col.models.nids(m)[0]).fields == ["1", "2", ""]
|
||||||
assert col.models.scmhash(m) != h
|
assert col.models.scmhash(m) != h
|
||||||
# rename it
|
# rename it
|
||||||
note = m["flds"][2]
|
field = m["flds"][2]
|
||||||
col.models.renameField(m, note, "bar")
|
col.models.renameField(m, field, "bar")
|
||||||
assert col.getNote(col.models.nids(m)[0])["bar"] == ""
|
assert col.getNote(col.models.nids(m)[0])["bar"] == ""
|
||||||
# delete back
|
# delete back
|
||||||
col.models.remField(m, m["flds"][1])
|
col.models.remField(m, m["flds"][1])
|
||||||
|
@ -62,8 +62,8 @@ def test_fields():
|
||||||
col.models.moveField(m, m["flds"][1], 0)
|
col.models.moveField(m, m["flds"][1], 0)
|
||||||
assert col.getNote(col.models.nids(m)[0]).fields == ["1", ""]
|
assert col.getNote(col.models.nids(m)[0]).fields == ["1", ""]
|
||||||
# add another and put in middle
|
# add another and put in middle
|
||||||
note = col.models.newField("baz")
|
field = col.models.newField("baz")
|
||||||
col.models.addField(m, note)
|
col.models.addField(m, field)
|
||||||
note = col.getNote(col.models.nids(m)[0])
|
note = col.getNote(col.models.nids(m)[0])
|
||||||
note["baz"] = "2"
|
note["baz"] = "2"
|
||||||
note.flush()
|
note.flush()
|
||||||
|
|
Loading…
Reference in a new issue