From 06b8c4e084d986468b6db0ae82fd7f30d74b36e4 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Sun, 18 Sep 2022 17:45:37 +0200 Subject: [PATCH] Fix migration & broken test --- alembic/versions/515dc3f52c6d_initial_migration.py | 1 + tests/test_database/test_crud/test_tasks.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/alembic/versions/515dc3f52c6d_initial_migration.py b/alembic/versions/515dc3f52c6d_initial_migration.py index 5b467c2..947a008 100644 --- a/alembic/versions/515dc3f52c6d_initial_migration.py +++ b/alembic/versions/515dc3f52c6d_initial_migration.py @@ -242,4 +242,5 @@ def downgrade() -> None: batch_op.drop_index(batch_op.f("ix_custom_commands_indexed_name")) op.drop_table("custom_commands") + sa.Enum("BIRTHDAYS", "SCHEDULES", "UFORA_ANNOUNCEMENTS", name="tasktype").drop(op.get_bind()) # ### end Alembic commands ### diff --git a/tests/test_database/test_crud/test_tasks.py b/tests/test_database/test_crud/test_tasks.py index f3adede..5aee4d5 100644 --- a/tests/test_database/test_crud/test_tasks.py +++ b/tests/test_database/test_crud/test_tasks.py @@ -46,7 +46,7 @@ async def test_set_execution_time_exists(postgres: AsyncSession, task: Task, tas await crud.set_last_task_execution_time(postgres, task_type) await postgres.refresh(task) - assert task.previous_run == datetime.datetime(year=2022, month=7, day=24) + assert task.previous_run == datetime.datetime(year=2022, month=7, day=24, tzinfo=datetime.timezone.utc) @freeze_time("2022/07/24") @@ -60,4 +60,4 @@ async def test_set_execution_time_doesnt_exist(postgres: AsyncSession, task_type results = list((await postgres.execute(statement)).scalars().all()) assert len(results) == 1 task = results[0] - assert task.previous_run == datetime.datetime(year=2022, month=7, day=24) + assert task.previous_run == datetime.datetime(year=2022, month=7, day=24, tzinfo=datetime.timezone.utc)