Skip to content

Commit f510d06

Browse files
committed
fix: correct primary key column references and ensure proper type casting in test fixtures
1 parent 299e946 commit f510d06

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/postgres-database/tests/test_users_details.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ async def product(
4343
async with insert_and_get_row_lifespan( # pylint:disable=contextmanager-generator-missing-cleanup # noqa: SIM117
4444
asyncpg_engine,
4545
table=groups,
46-
values=random_group(faker=faker, type=GroupType.STANDARD.name),
47-
pk_col=products.c.name,
46+
values=random_group(fake=faker, type=GroupType.STANDARD.name),
47+
pk_col=groups.c.gid,
4848
) as product_group:
4949
async with insert_and_get_row_lifespan( # pylint:disable=contextmanager-generator-missing-cleanup
5050
asyncpg_engine,
5151
table=products,
5252
values=random_product(
53-
fake=faker, name="s4l", group_id=product_group["gid"]
53+
fake=faker, name="s4l", group_id=int(product_group["gid"])
5454
),
5555
pk_col=products.c.name,
5656
) as row:
@@ -65,7 +65,12 @@ async def po_user(
6565
async with insert_and_get_row_lifespan( # pylint:disable=contextmanager-generator-missing-cleanup
6666
asyncpg_engine,
6767
table=users,
68-
values=random_user(faker, role=UserRole.PRODUCT_OWNER),
68+
values=random_user(
69+
faker,
70+
71+
name="po-user-fixture",
72+
role=UserRole.PRODUCT_OWNER,
73+
),
6974
pk_col=users.c.id,
7075
) as row:
7176
yield row

0 commit comments

Comments
 (0)