diff --git a/anki/importing/anki2.py b/anki/importing/anki2.py index 0df5e39ab..7dc64e4e2 100644 --- a/anki/importing/anki2.py +++ b/anki/importing/anki2.py @@ -256,7 +256,7 @@ class Anki2Importer(Importer): card[4] = intTime() card[5] = usn # review cards have a due date relative to collection - if card[7] in (2, 3): + if card[7] in (2, 3) or card[6] == 2: card[8] -= aheadBy # if odid true, convert card from filtered to normal if card[15]: diff --git a/tests/support/suspended12.anki b/tests/support/suspended12.anki new file mode 100644 index 000000000..5117847db Binary files /dev/null and b/tests/support/suspended12.anki differ diff --git a/tests/test_importing.py b/tests/test_importing.py index ec44a8a46..5ef27ab4d 100644 --- a/tests/test_importing.py +++ b/tests/test_importing.py @@ -163,6 +163,16 @@ def test_anki1_diffmodels(): assert after == before + 1 assert beforeModels == len(dst.models.all()) + +def test_suspended(): + # create a new empty deck + dst = getEmptyDeck() + # import the 1 card version of the model + tmp = getUpgradeDeckPath("suspended12.anki") + imp = Anki1Importer(dst, tmp) + imp.run() + assert dst.db.scalar("select due from cards") < 0 + def test_anki2_diffmodels(): # create a new empty deck dst = getEmptyDeck()