mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't throw error when update causes empty cards; fix unit test
This commit is contained in:
parent
7070b159d5
commit
5b97c3f20f
2 changed files with 4 additions and 2 deletions
|
@ -140,7 +140,9 @@ class NoteImporter(Importer):
|
|||
self.addUpdates(updates)
|
||||
self.col.updateFieldCache(self._ids)
|
||||
# generate cards
|
||||
assert not self.col.genCards(self._ids)
|
||||
if self.col.genCards(self._ids):
|
||||
self.log.insert(0, _(
|
||||
"Empty cards found. Please run Tools>Maintenance>Empty Cards."))
|
||||
# apply scheduling updates
|
||||
self.updateCards()
|
||||
# make sure to update sflds, etc
|
||||
|
|
|
@ -77,7 +77,7 @@ def test_findCards():
|
|||
assert len(deck.findCards("nid:%d,%d" % (f1id, f2id))) == 2
|
||||
# templates
|
||||
assert len(deck.findCards("card:foo")) == 0
|
||||
assert len(deck.findCards("card:forward")) == 4
|
||||
assert len(deck.findCards("'card:card 1'")) == 4
|
||||
assert len(deck.findCards("card:reverse")) == 1
|
||||
assert len(deck.findCards("card:1")) == 4
|
||||
assert len(deck.findCards("card:2")) == 1
|
||||
|
|
Loading…
Reference in a new issue