mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
18 lines
454 B
Python
18 lines
454 B
Python
from app.main.encryption import hashpw, check_hash
|
|
|
|
|
|
def test_should_hash_password():
|
|
password = 'passwordToHash'
|
|
assert password != hashpw(password)
|
|
|
|
|
|
def test_should_check_password():
|
|
value = 's3curePassword!'
|
|
encrypted = hashpw(value)
|
|
assert check_hash(value, encrypted) is True
|
|
|
|
|
|
def test_checkpw_should_fail_when_pw_does_not_match():
|
|
value = hashpw('somePassword')
|
|
assert check_hash('somethingDifferent', value) is False
|