diff --git a/flask_security/utils.py b/flask_security/utils.py index ddca6be..b9837c4 100644 --- a/flask_security/utils.py +++ b/flask_security/utils.py @@ -150,7 +150,7 @@ def encrypt_password(password): def md5(data): - return hashlib.md5(data.encode('ascii')).hexdigest() + return hashlib.md5(data.encode('utf-8')).hexdigest() def do_flash(message, category=None): diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 0c9519d..6bc3c52 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -24,11 +24,11 @@ def test_view_configuration(client): assert b"

Login

" in response.data response = authenticate(client, endpoint='/custom_login') - assert b'location' in response.headers + assert 'location' in response.headers assert response.headers['Location'] == 'http://localhost/post_login' response = logout(client, endpoint='/custom_logout') - assert b'location' in response.headers + assert 'location' in response.headers assert response.headers['Location'] == 'http://localhost/post_logout' response = client.get('/http', headers={