Skip to content

Commit

Permalink
Update test_unit_user_settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Sep 18, 2024
1 parent cae1d8c commit f3475b9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/no_version/test_unit_user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,23 @@ async def test_unit_link_user_to_settings(db):
assert user_C.settings is not None
assert user_C.user_settings_id is not None

# User associated to settings during its initial creation / second version
user_D = UserOAuth(
email="d@d.d",
hashed_password="xxx",
is_active=True,
is_superuser=False,
is_verified=True,
)
db.add(user_D)
await db.commit()
await db.refresh(user_D)
user_D.settings = UserSettings()
await db.merge(user_D)
await db.commit()
await db.refresh(user_D)
debug(user_D)
assert user_D.user_settings_id is not None
assert user_D.settings is not None

# FIXME: Test delete cascade

0 comments on commit f3475b9

Please sign in to comment.