mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Use encryption module from utils
Now that the encryption module has been moved from this app to utils, we can remove it from here (along with its tests) and import it from utils instead. This also renames the `encryption.py` file to `hashing.py`, since it no longer contains the encryption class.
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
from app.encryption import Encryption
|
||||
|
||||
encryption = Encryption()
|
||||
|
||||
|
||||
def test_should_encrypt_content(notify_api):
|
||||
encryption.init_app(notify_api)
|
||||
assert encryption.encrypt("this") != "this"
|
||||
|
||||
|
||||
def test_should_decrypt_content(notify_api):
|
||||
encryption.init_app(notify_api)
|
||||
encrypted = encryption.encrypt("this")
|
||||
assert encryption.decrypt(encrypted) == "this"
|
||||
|
||||
|
||||
def test_should_encrypt_json(notify_api):
|
||||
encryption.init_app(notify_api)
|
||||
encrypted = encryption.encrypt({"this": "that"})
|
||||
assert encryption.decrypt(encrypted) == {"this": "that"}
|
||||
Reference in New Issue
Block a user