Skip to content

Commit

Permalink
✨ feat: user password change test created for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
slugb0t committed Dec 20, 2023
1 parent ff5f2b7 commit bb637a8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/functional/test_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""Tests for user settings"""


# ------------------- Password Change ------------------- #
def test_put_password_change(clients):
"""
Given a Flask application configured for testing
WHEN the '/auth/password/change' endpoint is requested (PUT)
THEN check that the response is valid and the password is changed
"""
_logged_in_client, _admin_client, _editor_client, _viewer_client = clients

response = _logged_in_client.put(
"/auth/password/change",
json={
"confirm_password": "Updatedpassword4testing!",
"new_password": "Updatedpassword4testing!",
"old_password": "Testingyeshello11!",
}
)
admin_response = _admin_client.put(
"/auth/password/change",
json={
"confirm_password": "Updatedpassword4testing!",
"new_password": "Updatedpassword4testing!",
"old_password": "Testingyeshello11!",
}
)
editor_response = _editor_client.put(
"/auth/password/change",
json={
"confirm_password": "Updatedpassword4testing!",
"new_password": "Updatedpassword4testing!",
"old_password": "Testingyeshello11!",
}
)
viewer_response = _viewer_client.put(
"/auth/password/change",
json={
"confirm_password": "Updatedpassword4testing!",
"new_password": "Updatedpassword4testing!",
"old_password": "Testingyeshello11!",
}
)

assert response.status_code == 200
assert admin_response.status_code == 200
assert editor_response.status_code == 200
assert viewer_response.status_code == 200

0 comments on commit bb637a8

Please sign in to comment.