mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-29 10:03:25 +02:00
Use the tag-related Task methods in the Tags column type (#3911)
Use the tag-related Task methods in the Tags column type This column type was taking a shortcut by assuming the `tags` property contains a comma-separated list of tags. This property is now deprecated and tags are stored in individual properties. The tag-related Task methods correctly access these new properties. Includes a test for the fixed behavior and a test demonstrating that `task info` already does the right thing.
This commit is contained in:
parent
236b57f321
commit
0282ea8b8a
5 changed files with 55 additions and 16 deletions
|
@ -74,6 +74,30 @@ class TestCustomReports(TestCase):
|
|||
self.assertIn("[44m", out)
|
||||
|
||||
|
||||
class TestReportTags(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
self.t = Task()
|
||||
self.t.config("report.foo.description", "DESC")
|
||||
self.t.config("report.foo.labels", "ID,TAGS")
|
||||
self.t.config("report.foo.columns", "id,tags")
|
||||
self.t.config("report.foo.sort", "id+")
|
||||
|
||||
def test_report_with_tags(self):
|
||||
"""Verify custom report includes tags even when `tags` property is not included"""
|
||||
# Create a task directly with TC, avoiding TaskWarrior's creation of the deprecated
|
||||
# `tags` property.
|
||||
uuid = self.t.make_tc_task(
|
||||
status="pending",
|
||||
description="task with tags",
|
||||
tag_tag1="x",
|
||||
tag_tag2="x",
|
||||
)
|
||||
code, out, err = self.t("foo")
|
||||
self.assertIn("tag1", out)
|
||||
self.assertIn("tag2", out)
|
||||
|
||||
|
||||
class TestCustomErrorHandling(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue