Skip to content

Commit

Permalink
fix: add last test
Browse files Browse the repository at this point in the history
  • Loading branch information
pscemama-mitre committed May 17, 2024
1 parent 709aa47 commit 419cc66
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/unit/restapi/v1/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,16 @@ def test_change_user_password(
assert_login_works(client, username="user2", password=new_password)


# @pytest.mark.v1
# def test_new_password_cannot_be_existing(
# client: FlaskClient,
# db: SQLAlchemy,
# auth_account: dict[str, Any],
# old_password: str,
# user_id: str,
# ):
# new_password = old_password
# assert change_current_user_password(client, old_password, new_password).status_code == 400
# assert change_user_password(client, user_id, old_password, new_password).status_code == 400
@pytest.mark.v1
def test_new_password_cannot_be_existing(
client: FlaskClient,
db: SQLAlchemy,
auth_account: dict[str, Any],
registered_users: dict[str, Any],
):
old_password = new_password = registered_users["user1"]
assert change_current_user_password(client, old_password, new_password).status_code == 400

old_password = new_password = registered_users["user2"]
user_id = registered_users["user2"]["id"]
assert change_user_password(client, user_id, old_password, new_password).status_code == 400

0 comments on commit 419cc66

Please sign in to comment.