Skip to content

Commit

Permalink
[qa] fix test zou/tests/services/test_comments_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Jun 21, 2024
1 parent b42c73b commit 14e3901
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/services/test_comments_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ def test_manage_status_change(self):
)
self.assertTrue(status_changed)
self.assertEqual(task["retake_count"], 1)

old_comment = comments_service.new_comment(
self.task.id,
retake_status["id"],
self.user["id"],
"old comment",
created_at="1999-12-23 10:00:00",
)
(task, status_changed) = comments_service._manage_status_change(
retake_status, task, old_comment
)

self.assertFalse(status_changed)
self.assertEqual(task["retake_count"], 1)

(task, status_changed) = comments_service._manage_status_change(
self.wfa_status, task, comment
)
Expand Down
2 changes: 1 addition & 1 deletion zou/app/services/comments_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _get_comment_author(person_id):
def _manage_status_change(task_status, task, comment):
is_last_comment = (
task["last_comment_date"] is None
or task["last_comment_date"] < comment["created_at"]
or task["last_comment_date"] <= comment["created_at"]
)
if not is_last_comment:
status_changed = False
Expand Down

0 comments on commit 14e3901

Please sign in to comment.