Skip to content

Commit 27ee2d2

Browse files
committed
fixes migration
1 parent 995dff2 commit 27ee2d2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

migrations/versions/40_promo_above_2000.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"""
55

66
import uuid
7-
from typing import TYPE_CHECKING, Sequence, Union
7+
from collections.abc import Sequence
8+
from typing import TYPE_CHECKING
89

910
from app.core.schools.schools_type import SchoolType
1011

@@ -14,8 +15,6 @@
1415
import sqlalchemy as sa
1516
from alembic import op
1617

17-
from app.types.sqlalchemy import TZDateTime
18-
1918
# revision identifiers, used by Alembic.
2019
revision: str = "91fadc90f892"
2120
down_revision: str | None = "2880c583d7f1"
@@ -84,19 +83,19 @@ def test_upgrade(
8483
) -> None:
8584
assert (
8685
alembic_connection.execute(
87-
sa.text(f"SELECT promo FROM core_user WHERE user_id = {user_id_23}"),
88-
).first()[9]
86+
sa.text(f"SELECT promo FROM core_user WHERE user_id = '{user_id_23}'"),
87+
).first()[0]
8988
== 2023
9089
)
9190
assert (
9291
alembic_connection.execute(
93-
sa.text(f"SELECT promo FROM core_user WHERE user_id = {user_id_2023}"),
94-
).first()[9]
92+
sa.text(f"SELECT promo FROM core_user WHERE user_id = '{user_id_2023}'"),
93+
).first()[0]
9594
== 2023
9695
)
9796
assert (
9897
alembic_connection.execute(
99-
sa.text(f"SELECT promo FROM core_user WHERE user_id = {user_id_null}"),
100-
).first()[9]
98+
sa.text(f"SELECT promo FROM core_user WHERE user_id = '{user_id_null}'"),
99+
).first()[0]
101100
is None
102101
)

0 commit comments

Comments
 (0)