mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
add unit test for v2 lrn scheduling bug
https://anki.tenderapp.com/discussions/ankimobile/9714-deleting-custom-study-deck-skips-learning-step-time
This commit is contained in:
parent
e2791d812f
commit
bf4b287d15
1 changed files with 16 additions and 0 deletions
|
@ -708,14 +708,22 @@ def test_filt_reviewing_early_normal():
|
|||
|
||||
def test_filt_keep_lrn_state():
|
||||
d = getEmptyCol()
|
||||
|
||||
f = d.newNote()
|
||||
f['Front'] = "one"
|
||||
d.addNote(f)
|
||||
|
||||
# fail the card outside filtered deck
|
||||
c = d.sched.getCard()
|
||||
d.sched._cardConf(c)['new']['delays'] = [1, 10, 61]
|
||||
d.decks.save()
|
||||
|
||||
d.sched.answerCard(c, 1)
|
||||
|
||||
assert c.type == c.queue == 1
|
||||
assert c.left == 3003
|
||||
|
||||
d.sched.answerCard(c, 3)
|
||||
assert c.type == c.queue == 1
|
||||
|
||||
# create a dynamic deck and refresh it
|
||||
|
@ -726,11 +734,19 @@ def test_filt_keep_lrn_state():
|
|||
# card should still be in learning state
|
||||
c.load()
|
||||
assert c.type == c.queue == 1
|
||||
assert c.left == 2002
|
||||
|
||||
# should be able to advance learning steps
|
||||
d.sched.answerCard(c, 3)
|
||||
# should be due at least an hour in the future
|
||||
assert c.due - intTime() > 60*60
|
||||
|
||||
# emptying the deck preserves learning state
|
||||
d.sched.emptyDyn(did)
|
||||
c.load()
|
||||
assert c.type == c.queue == 1
|
||||
assert c.left == 1001
|
||||
assert c.due - intTime() > 60*60
|
||||
|
||||
def test_preview():
|
||||
# add cards
|
||||
|
|
Loading…
Reference in a new issue