TW-1700: modify tags behavior changed
- Thanks to David Badura.
This commit is contained in:
@@ -159,6 +159,7 @@
|
||||
- TW-1692 '42//' segfaults (thanks to Daniel Shahaf).
|
||||
- TW-1695 edit: Concurrent edits (thanks to Daniel Shahaf).
|
||||
- TW-1699 Command interpretation displayed incorrectly (thanks to Tomas Babej).
|
||||
- TW-1700 modify tags behavior changed (thanks to David Badura).
|
||||
- TW-1701 Some generated UUIDs deemed invalid (thanks to Wim Schuermann).
|
||||
- Prevent potential task duplication during import for non-pending tasks.
|
||||
- Show the active context in "context list", if any is active.
|
||||
|
||||
@@ -2060,6 +2060,9 @@ void Task::modify (modType type, bool text_required /* = false */)
|
||||
// For those using the "tags:..." attribute directly.
|
||||
else if (name == "tags")
|
||||
{
|
||||
// TW-1701
|
||||
set ("tags", "");
|
||||
|
||||
std::vector <std::string> tags;
|
||||
split (tags, value, ',');
|
||||
|
||||
|
||||
17
test/tag.t
17
test/tag.t
@@ -488,6 +488,23 @@ class TestListAllTags(TestCase):
|
||||
self.assertIn("t2", out)
|
||||
|
||||
|
||||
class TestBug1700(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
|
||||
def test_tags_overwrite(self):
|
||||
"""Verify that 'tags:a,b' overwrites existing tags."""
|
||||
self.t("add +tag1 +tag2 one")
|
||||
code, out, err = self.t("_get 1.tags")
|
||||
self.assertIn("tag1,tag2", out)
|
||||
self.assertNotIn("tag3", out)
|
||||
|
||||
self.t("1 modify tags:tag2,tag3")
|
||||
code, out, err = self.t("_get 1.tags")
|
||||
self.assertNotIn("tag1", out)
|
||||
self.assertIn("tag2,tag3", out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
||||
Reference in New Issue
Block a user