mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
Fix tests to pass python 3
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -24,11 +24,11 @@ def test_view_configuration(client):
|
||||
assert b"<h1>Login</h1>" 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={
|
||||
|
||||
Reference in New Issue
Block a user