Skip to content

Commit a7fd5b5

Browse files
authored
Add swimlane to user story allowed_params (#193)
1 parent ad5d00d commit a7fd5b5

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

changes/185.bugfix

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

taiga/models/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ class UserStory(CustomAttributeResource, CommentableResource):
453453
"due_date",
454454
"generated_from_issue",
455455
"generated_from_task",
456+
"swimlane",
456457
]
457458

458459
def add_task(self, subject, status, **attrs):

tests/test_user_stories.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from taiga import TaigaAPI
55
from taiga.exceptions import TaigaException
6-
from taiga.models import Task, UserStories, UserStory
6+
from taiga.models import Project, SwimLane, Task, UserStories, UserStory, UserStoryStatus
77
from taiga.requestmaker import RequestMaker
88

99
from .tools import MockResponse, create_mock_json
@@ -140,3 +140,20 @@ def test_add_comment(self, mock_update):
140140
user_story = UserStory(rm, id=1)
141141
user_story.add_comment("hola")
142142
mock_update.assert_called_with(comment="hola")
143+
144+
@patch("taiga.requestmaker.RequestMaker.put")
145+
def test_swimlane_is_in_userstory_update_payload(self, mock_update):
146+
rm = RequestMaker("/api/v1", "fakehost", "faketoken")
147+
swimlane = SwimLane(rm, id=1)
148+
project = Project(rm, id=1)
149+
status_1 = UserStoryStatus(rm, id=1, project=project)
150+
status_2 = UserStoryStatus(rm, id=2, project=project)
151+
user_story = UserStory(rm, id=1, project=project.id, swimlane=swimlane.id, status=status_1)
152+
user_story.status = 2
153+
user_story.update()
154+
mock_update.assert_called_with(
155+
"/{endpoint}/{id}",
156+
endpoint=UserStory.endpoint,
157+
id=user_story.id,
158+
payload={"project": project.id, "swimlane": swimlane.id, "status": status_2.id},
159+
)

0 commit comments

Comments
 (0)