Skip to content

Commit

Permalink
Merge pull request ankitects#695 from Arthur-Milchior/note->field
Browse files Browse the repository at this point in the history
replace "note" by "field"
  • Loading branch information
dae authored Jul 20, 2020
2 parents 917d53a + bff784d commit 63c0557
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pylib/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def test_fields():
assert "{{NewFront}}" in m["tmpls"][0]["qfmt"]
h = col.models.scmhash(m)
# add a field
note = col.models.newField("foo")
col.models.addField(m, note)
field = col.models.newField("foo")
col.models.addField(m, field)
assert col.getNote(col.models.nids(m)[0]).fields == ["1", "2", ""]
assert col.models.scmhash(m) != h
# rename it
note = m["flds"][2]
col.models.renameField(m, note, "bar")
field = m["flds"][2]
col.models.renameField(m, field, "bar")
assert col.getNote(col.models.nids(m)[0])["bar"] == ""
# delete back
col.models.remField(m, m["flds"][1])
Expand All @@ -62,8 +62,8 @@ def test_fields():
col.models.moveField(m, m["flds"][1], 0)
assert col.getNote(col.models.nids(m)[0]).fields == ["1", ""]
# add another and put in middle
note = col.models.newField("baz")
col.models.addField(m, note)
field = col.models.newField("baz")
col.models.addField(m, field)
note = col.getNote(col.models.nids(m)[0])
note["baz"] = "2"
note.flush()
Expand Down

0 comments on commit 63c0557

Please sign in to comment.