Test: Add confirmation test on recurrence.t

I'm a little unsure about the correct behaviour here.
I would expect both features to depend on rc.recurrence.confirmation and
not rc.confirmation. Yet when rc.confirmation=on no prompt is shown
about recurring parents.
This commit is contained in:
Renato Alves 2015-07-28 19:59:19 +01:00
parent 0f8c995934
commit 3908c29a21

View file

@ -312,15 +312,29 @@ class TestBug955(TestCase):
def setUp(self): def setUp(self):
self.t = Task() self.t = Task()
def test_no_prompt_for_parent_on_child_delete(self):
"""Deleting a child of a recurring task doesn't prompt for parent deletion
Previously bug.955.t
"""
self.t("add foo due:now recur:1day") self.t("add foo due:now recur:1day")
code, out, err = self.t("ls") code, out, err = self.t("ls")
self.assertRegexpMatches(out, re.compile("^2 tasks", re.MULTILINE)) self.assertRegexpMatches(out, re.compile("^2 tasks", re.MULTILINE))
def test_no_prompt_for_parent_on_child_delete_confirmation_off(self):
"""Deleting a child of a recurring task prompts for parent deletion (confirmation:off)
Previously bug.955.t
"""
self.t.config("confirmation", "off")
self.validate()
def test_no_prompt_for_parent_on_child_delete_confirmation_on(self):
"""Deleting a child of a recurring task prompts for parent deletion (confirmation:on)
Previously bug.955.t
"""
self.t.config("confirmation", "on")
self.validate()
def validate(self):
code, out, err = self.t("2 delete", input="n\ny\n") code, out, err = self.t("2 delete", input="n\ny\n")
self.assertIn("Deleting task 2", out) self.assertIn("Deleting task 2", out)
self.assertIn("Deleted 1 task", out) self.assertIn("Deleted 1 task", out)