MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / test_update_user

Function test_update_user

backend/tests/users/test_services.py:83–95  ·  view source on GitHub ↗
(db: Session)

Source from the content-addressed store, hash-verified

81
82
83def test_update_user(db: Session) -> None:
84 password = random_lower_string()
85 email = random_email()
86 user_in = UserCreate(email=email, password=password, is_superuser=True)
87 user = create_user(session=db, user_create=user_in)
88 new_password = random_lower_string()
89 user_in_update = UserUpdate(password=new_password, is_superuser=True)
90 if user.id is not None:
91 update_user(session=db, db_user=user, user_in=user_in_update)
92 user_2 = db.get(User, user.id)
93 assert user_2
94 assert user.email == user_2.email
95 assert verify_password(new_password, user_2.hashed_password)
96
97
98def test_get_ai_usage_quota_for_user_no_quota(test_user):

Callers

nothing calls this directly

Calls 7

random_lower_stringFunction · 0.90
random_emailFunction · 0.90
UserCreateClass · 0.90
create_userFunction · 0.90
UserUpdateClass · 0.90
update_userFunction · 0.90
verify_passwordFunction · 0.90

Tested by

no test coverage detected