Skip to content

Commit dfe24ab

Browse files
committed
Fix test base models and non-nullable integrity test
1 parent 205c6a6 commit dfe24ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_fastapi_users_db_sqlmodel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ async def test_queries(sqlmodel_user_db: SQLModelUserDatabase[UserDB, OAuthAccou
7373

7474
# Exception when inserting non-nullable fields
7575
with pytest.raises(exc.IntegrityError):
76-
wrong_user = UserDB(hashed_password="aaa")
76+
wrong_user = UserDB(email="[email protected]", hashed_password="aaa")
77+
wrong_user.email = None # type: ignore
7778
await sqlmodel_user_db.create(wrong_user)
7879

7980
# Unknown user
@@ -125,7 +126,6 @@ async def test_queries_oauth(
125126
# Create
126127
user_db = await sqlmodel_user_db_oauth.create(user)
127128
assert user_db.id is not None
128-
print(type(user_db), user_db)
129129
assert hasattr(user_db, "oauth_accounts")
130130
assert len(user_db.oauth_accounts) == 2
131131

0 commit comments

Comments
 (0)