Skip to content

Commit 8e2ec97

Browse files
committed
Add missing due_date to Issue allowed_params
1 parent f60dfa4 commit 8e2ec97

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

changes/196.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add missing due_date to Issue allowed_params

taiga/models/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ class Issue(CustomAttributeResource, CommentableResource):
959959
"subject",
960960
"tags",
961961
"watchers",
962+
"due_date",
962963
]
963964

964965
def list_attachments(self):

tests/test_issues.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from unittest.mock import patch
33

44
from taiga.exceptions import TaigaException
5-
from taiga.models import Issue, Issues
5+
from taiga.models import Issue, Issues, Project
66
from taiga.requestmaker import RequestMaker
77

88
from .tools import MockResponse, create_mock_json
@@ -96,3 +96,17 @@ def test_add_comment(self, mock_update):
9696
issue = Issue(rm, id=1)
9797
issue.add_comment("hola")
9898
mock_update.assert_called_with(comment="hola")
99+
100+
@patch("taiga.requestmaker.RequestMaker.put")
101+
def test_due_date_is_in_issue_update_payload(self, mock_update):
102+
rm = RequestMaker("/api/v1", "fakehost", "faketoken")
103+
project = Project(rm, id=1)
104+
issue = Issue(rm, id=1, project=project.id)
105+
issue.due_date = "2025-01-22"
106+
issue.update()
107+
mock_update.assert_called_with(
108+
"/{endpoint}/{id}",
109+
endpoint=Issue.endpoint,
110+
id=issue.id,
111+
payload={"project": project.id, "due_date": issue.due_date},
112+
)

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ envlist =
99
pypi-description
1010
towncrier
1111
py{311,310,39}
12-
py{311,310,39}
1312

1413
[testenv]
1514
commands = {env:COMMAND:python} -m pytest {posargs}

0 commit comments

Comments
 (0)