Skip to content

Commit cd02af2

Browse files
committed
fix flaky test_patch_project
1 parent 7f5049f commit cd02af2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/web/server/tests/unit/with_dbs/02/test_projects_repository.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# pylint: disable=unused-variable
44
# pylint: disable=too-many-arguments
55

6-
from datetime import timedelta
6+
from datetime import datetime, timedelta
77
from uuid import UUID
88

99
import arrow
@@ -55,7 +55,9 @@ async def test_patch_project(
5555
assert client.app
5656

5757
# This will change after in patched_project
58-
assert user_project["creationDate"] == user_project["lastChangeDate"]
58+
creation_date = datetime.fromisoformat(user_project["creationDate"])
59+
last_change_date = datetime.fromisoformat(user_project["lastChangeDate"])
60+
assert abs(creation_date - last_change_date) < timedelta(seconds=1)
5961

6062
# Patch valid project
6163
patch_data = {"name": "Updated Project Name"}

0 commit comments

Comments
 (0)