set timezone to CUT

This commit is contained in:
Simone Robutti 2022-03-04 10:55:38 +01:00
parent cb0fe7b5fc
commit dae9dfd889
3 changed files with 7 additions and 16 deletions

View File

@ -28,11 +28,11 @@ async def test_list_events(capsys, generate_models):
output = capsys.readouterr()
assert clean_output(output) == [
"event_0 WAITING 00000000-0000-0000-0000-000000000000"
" 2021-06-06T05:00:00+02:00 2021-06-06T07:00:00+02:00",
" 2021-06-06T03:00:00+00:00 2021-06-06T05:00:00+00:00",
"event_1 COMPLETED 00000000-0000-0000-0000-000000000001"
" 2021-06-07T05:00:00+02:00 2021-06-07T07:00:00+02:00",
" 2021-06-07T03:00:00+00:00 2021-06-07T05:00:00+00:00",
"event_2 FAILED 00000000-0000-0000-0000-000000000002"
" 2021-06-08T05:00:00+02:00 2021-06-08T07:00:00+02:00",
" 2021-06-08T03:00:00+00:00 2021-06-08T05:00:00+00:00",
]
@ -43,7 +43,7 @@ async def test_list_events_with_status(capsys, generate_models):
output = capsys.readouterr()
assert clean_output(output) == [
"event_0 WAITING 00000000-0000-0000-0000-000000000000"
" 2021-06-06T05:00:00+02:00 2021-06-06T07:00:00+02:00"
" 2021-06-06T03:00:00+00:00 2021-06-06T05:00:00+00:00"
]

View File

@ -39,7 +39,7 @@ def generate_publication_status(published):
@pytest.fixture(autouse=True)
def set_timezone():
os.environ["TZ"] = "Europe/Rome"
os.environ["TZ"] = "Coordinated Universal Time"
time.tzset()

View File

@ -1,4 +1,4 @@
from datetime import datetime, timedelta, timezone
from datetime import datetime
from uuid import UUID
import arrow
@ -7,16 +7,7 @@ import pytest
from mobilizon_reshare.event.event import MobilizonEvent
from mobilizon_reshare.publishers.platforms.platform_mapping import get_formatter_class
begin_date = arrow.get(
datetime(
year=2021,
month=1,
day=1,
hour=11,
minute=30,
tzinfo=timezone(timedelta(hours=1)),
)
).to("local")
begin_date = arrow.get(datetime(year=2021, month=1, day=1, hour=11, minute=30,))
end_date = begin_date.shift(hours=1)