mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 15:47:12 -05:00
Test: rename over filtered deck
This commit is contained in:
parent
a4cb3debe2
commit
3d6c0ec36c
1 changed files with 9 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
|
from anki.errors import DeckRenameError
|
||||||
from tests.shared import assertException, getEmptyCol
|
from tests.shared import assertException, getEmptyCol
|
||||||
|
|
||||||
def test_basic():
|
def test_basic():
|
||||||
|
|
@ -87,6 +88,14 @@ def test_rename():
|
||||||
d.decks.rename(d.decks.get(id), "yo")
|
d.decks.rename(d.decks.get(id), "yo")
|
||||||
for n in "yo", "yo::two", "yo::two::three":
|
for n in "yo", "yo::two", "yo::two::three":
|
||||||
assert n in d.decks.allNames()
|
assert n in d.decks.allNames()
|
||||||
|
# over filtered
|
||||||
|
parentId = d.decks.newDyn("parent")
|
||||||
|
parent = d.decks.get(parentId)
|
||||||
|
childId = d.decks.id("child")
|
||||||
|
child = d.decks.get(childId)
|
||||||
|
assertException(DeckRenameError, lambda: d.decks.rename(child, "parent::child"))
|
||||||
|
assertException(DeckRenameError, lambda: d.decks.rename(child, "PARENT::child"))
|
||||||
|
|
||||||
|
|
||||||
def test_renameForDragAndDrop():
|
def test_renameForDragAndDrop():
|
||||||
d = getEmptyCol()
|
d = getEmptyCol()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue