Merge pull request #698 from Arthur-Milchior/remove_clear_overdue

remove _clearOverdue
This commit is contained in:
Damien Elmes 2020-07-21 10:27:04 +10:00 committed by GitHub
commit 15f13145ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 14 deletions

View file

@ -417,7 +417,6 @@ def test_overdue_lapse():
c.left = 2002 c.left = 2002
c.ivl = 0 c.ivl = 0
c.flush() c.flush()
col.sched._clearOverdue = False
# checkpoint # checkpoint
col.save() col.save()
col.sched.reset() col.sched.reset()
@ -428,7 +427,6 @@ def test_overdue_lapse():
assert c.due == col.sched.today + 1 assert c.due == col.sched.today + 1
# revert to before # revert to before
col.rollback() col.rollback()
col.sched._clearOverdue = True
# with the default settings, the overdue card should be removed from the # with the default settings, the overdue card should be removed from the
# learning queue # learning queue
col.sched.reset() col.sched.reset()
@ -568,7 +566,7 @@ def test_suspend():
# should cope with cards in cram decks # should cope with cards in cram decks
c.due = 1 c.due = 1
c.flush() c.flush()
cram = col.decks.newDyn("tmp") col.decks.newDyn("tmp")
col.sched.rebuildDyn() col.sched.rebuildDyn()
c.load() c.load()
assert c.due != 1 assert c.due != 1
@ -682,7 +680,6 @@ def test_cram():
c2.id = 0 c2.id = 0
c2.ord = 1 c2.ord = 1
c2.due = 325 c2.due = 325
c2.col = c.col
c2.flush() c2.flush()
# should be able to answer it # should be able to answer it
c = col.sched.getCard() c = col.sched.getCard()
@ -993,12 +990,12 @@ def test_deckDue():
# add one more with a new deck # add one more with a new deck
note = col.newNote() note = col.newNote()
note["Front"] = "two" note["Front"] = "two"
foobar = note.model()["did"] = col.decks.id("foo::bar") note.model()["did"] = col.decks.id("foo::bar")
col.addNote(note) col.addNote(note)
# and one that's a sibling # and one that's a sibling
note = col.newNote() note = col.newNote()
note["Front"] = "three" note["Front"] = "three"
foobaz = note.model()["did"] = col.decks.id("foo::baz") note.model()["did"] = col.decks.id("foo::baz")
col.addNote(note) col.addNote(note)
col.reset() col.reset()
assert len(col.decks.all_names_and_ids()) == 5 assert len(col.decks.all_names_and_ids()) == 5
@ -1029,7 +1026,7 @@ def test_deckFlow():
# and one that's a child # and one that's a child
note = col.newNote() note = col.newNote()
note["Front"] = "two" note["Front"] = "two"
default1 = note.model()["did"] = col.decks.id("Default::2") note.model()["did"] = col.decks.id("Default::2")
col.addNote(note) col.addNote(note)
# and another that's higher up # and another that's higher up
note = col.newNote() note = col.newNote()

View file

@ -395,7 +395,7 @@ def test_reviews():
c = copy.copy(cardcopy) c = copy.copy(cardcopy)
c.lapses = 7 c.lapses = 7
c.flush() c.flush()
# steup hook # setup hook
hooked = [] hooked = []
def onLeech(card): def onLeech(card):
@ -509,7 +509,6 @@ def test_overdue_lapse():
c.left = 2002 c.left = 2002
c.ivl = 0 c.ivl = 0
c.flush() c.flush()
col.sched._clearOverdue = False
# checkpoint # checkpoint
col.save() col.save()
col.sched.reset() col.sched.reset()
@ -520,7 +519,6 @@ def test_overdue_lapse():
assert c.due == col.sched.today + 1 assert c.due == col.sched.today + 1
# revert to before # revert to before
col.rollback() col.rollback()
col.sched._clearOverdue = True
# with the default settings, the overdue card should be removed from the # with the default settings, the overdue card should be removed from the
# learning queue # learning queue
col.sched.reset() col.sched.reset()
@ -692,7 +690,7 @@ def test_suspend():
# should cope with cards in cram decks # should cope with cards in cram decks
c.due = 1 c.due = 1
c.flush() c.flush()
cram = col.decks.newDyn("tmp") col.decks.newDyn("tmp")
col.sched.rebuildDyn() col.sched.rebuildDyn()
c.load() c.load()
assert c.due != 1 assert c.due != 1
@ -1019,12 +1017,12 @@ def test_deckDue():
# add one more with a new deck # add one more with a new deck
note = col.newNote() note = col.newNote()
note["Front"] = "two" note["Front"] = "two"
foobar = note.model()["did"] = col.decks.id("foo::bar") note.model()["did"] = col.decks.id("foo::bar")
col.addNote(note) col.addNote(note)
# and one that's a sibling # and one that's a sibling
note = col.newNote() note = col.newNote()
note["Front"] = "three" note["Front"] = "three"
foobaz = note.model()["did"] = col.decks.id("foo::baz") note.model()["did"] = col.decks.id("foo::baz")
col.addNote(note) col.addNote(note)
col.reset() col.reset()
assert len(col.decks.all_names_and_ids()) == 5 assert len(col.decks.all_names_and_ids()) == 5
@ -1065,7 +1063,7 @@ def test_deckFlow():
# and one that's a child # and one that's a child
note = col.newNote() note = col.newNote()
note["Front"] = "two" note["Front"] = "two"
default1 = note.model()["did"] = col.decks.id("Default::2") note.model()["did"] = col.decks.id("Default::2")
col.addNote(note) col.addNote(note)
# and another that's higher up # and another that's higher up
note = col.newNote() note = col.newNote()