diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
commit | dec47c7102cf0aa3a4debf002928db8e460c0d71 (patch) | |
tree | 47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/tests/test_basic_auth.py | |
parent | 5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff) | |
download | mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.lz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.xz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.zip |
Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.
Diffstat (limited to 'mediagoblin/tests/test_basic_auth.py')
-rw-r--r-- | mediagoblin/tests/test_basic_auth.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mediagoblin/tests/test_basic_auth.py b/mediagoblin/tests/test_basic_auth.py index 3a42e407..f7553fe1 100644 --- a/mediagoblin/tests/test_basic_auth.py +++ b/mediagoblin/tests/test_basic_auth.py @@ -68,13 +68,13 @@ def test_bcrypt_gen_password_hash(): def test_change_password(test_app): """Test changing password correctly and incorrectly""" test_user = fixture_add_user( - password=u'toast', - privileges=[u'active']) + password='toast', + privileges=['active']) test_app.post( '/auth/login/', { - 'username': u'chris', - 'password': u'toast'}) + 'username': 'chris', + 'password': 'toast'}) # test that the password can be changed res = test_app.post( @@ -88,7 +88,7 @@ def test_change_password(test_app): assert urlparse.urlsplit(res.location)[2] == '/edit/account/' # test_user has to be fetched again in order to have the current values - test_user = LocalUser.query.filter(LocalUser.username==u'chris').first() + test_user = LocalUser.query.filter(LocalUser.username=='chris').first() assert auth_tools.bcrypt_check_password('123456', test_user.pw_hash) # test that the password cannot be changed if the given @@ -100,5 +100,5 @@ def test_change_password(test_app): 'new_password': '098765', }) - test_user = LocalUser.query.filter(LocalUser.username==u'chris').first() + test_user = LocalUser.query.filter(LocalUser.username=='chris').first() assert not auth_tools.bcrypt_check_password('098765', test_user.pw_hash) |