Skip to content

Commit 1a34fc8

Browse files
author
Rafael Marinho
committed
tests(cha-648) fix unit tests
1 parent 7e3a0ae commit 1a34fc8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

stream_chat/tests/test_live_locations.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
from typing import Dict
23

34
import pytest
@@ -13,9 +14,13 @@ def test_get_user_locations(self, client: StreamChat, random_user: Dict):
1314
channel.create(random_user["id"])
1415

1516
# Create a message to attach location to
17+
now = datetime.datetime.now(datetime.timezone.utc)
18+
one_hour_later = now + datetime.timedelta(hours=1)
1619
shared_location = {
20+
"created_by_device_id": "test_device_id",
1721
"latitude": 37.7749,
1822
"longitude": -122.4194,
23+
"end_at": one_hour_later.isoformat(),
1924
}
2025

2126
channel.send_message(
@@ -35,9 +40,13 @@ def test_update_user_location(self, client: StreamChat, random_user: Dict):
3540
channel.create(random_user["id"])
3641

3742
# Create a message to attach location to
43+
now = datetime.datetime.now(datetime.timezone.utc)
44+
one_hour_later = now + datetime.timedelta(hours=1)
3845
shared_location = {
46+
"created_by_device_id": "test_device_id",
3947
"latitude": 37.7749,
4048
"longitude": -122.4194,
49+
"end_at": one_hour_later.isoformat(),
4150
}
4251

4352
msg = channel.send_message(

0 commit comments

Comments
 (0)