|
3 | 3 |
|
4 | 4 | from taiga import TaigaAPI |
5 | 5 | from taiga.exceptions import TaigaException |
6 | | -from taiga.models import Task, UserStories, UserStory |
| 6 | +from taiga.models import Project, SwimLane, Task, UserStories, UserStory, UserStoryStatus |
7 | 7 | from taiga.requestmaker import RequestMaker |
8 | 8 |
|
9 | 9 | from .tools import MockResponse, create_mock_json |
@@ -140,3 +140,20 @@ def test_add_comment(self, mock_update): |
140 | 140 | user_story = UserStory(rm, id=1) |
141 | 141 | user_story.add_comment("hola") |
142 | 142 | 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