From 9369e99b2a63af858df221e6c88757f27d8b9d26 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 14 Jun 2019 09:15:38 +1000 Subject: [PATCH] and test to catch v2 relearning reset bug https://anki.tenderapp.com/discussions/ankidesktop/34560-schedule-switching-bug --- tests/test_schedv2.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_schedv2.py b/tests/test_schedv2.py index 1610723fd..078cea804 100644 --- a/tests/test_schedv2.py +++ b/tests/test_schedv2.py @@ -1165,3 +1165,17 @@ def test_moveVersions(): col.sched.unburyCards() c.load() assert c.queue == c.type == 0 + + # make sure relearning cards transition correctly to v1 + col.changeSchedulerVer(2) + # card with 100 day interval, answering again + col.sched.reschedCards([c.id], 100, 100) + c.load(); c.due = 0; c.flush() + col.sched._cardConf(c)['lapse']['mult'] = 0.5 + col.sched.reset() + c = col.sched.getCard() + col.sched.answerCard(c, 1) + # due should be correctly set when removed from learning early + col.changeSchedulerVer(1) + c.load() + assert c.due == 50