From 96f1b3e0d113677da742ec05ccd7f539705ec682 Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Tue, 10 Jun 2014 11:11:53 -0400 Subject: [PATCH] Fix tests to pass python 3 --- flask_security/utils.py | 2 +- tests/test_configuration.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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={