@@ -25,7 +25,7 @@ def test_default_headers(app):
2525
2626 with app .test_request_context ():
2727 access_token = create_access_token ('username' )
28-
28+
2929 # Ensure other authorization types don't work
3030 access_headers = {'Authorization' : 'Basic basiccreds' }
3131 response = test_client .get ('/protected' , headers = access_headers )
@@ -40,13 +40,13 @@ def test_default_headers(app):
4040 assert response .get_json () == {'foo' : 'bar' }
4141
4242 # Ensure default headers work with multiple field values
43- access_headers = {'Authorization' : 'Bearer {}, Basic randomcredshere ' .format (access_token )}
43+ access_headers = {'Authorization' : 'Bearer {}, Basic creds ' .format (access_token )}
4444 response = test_client .get ('/protected' , headers = access_headers )
4545 assert response .status_code == 200
4646 assert response .get_json () == {'foo' : 'bar' }
4747
4848 # Ensure default headers work with multiple field values in any position
49- access_headers = {'Authorization' : 'Basic randomcredshere , Bearer {}' .format (access_token )}
49+ access_headers = {'Authorization' : 'Basic creds , Bearer {}' .format (access_token )}
5050 response = test_client .get ('/protected' , headers = access_headers )
5151 assert response .status_code == 200
5252 assert response .get_json () == {'foo' : 'bar' }
@@ -58,7 +58,7 @@ def test_custom_header_name(app):
5858
5959 with app .test_request_context ():
6060 access_token = create_access_token ('username' )
61-
61+
6262 # Insure 'default' headers no longer work
6363 access_headers = {'Authorization' : 'Bearer {}' .format (access_token )}
6464 response = test_client .get ('/protected' , headers = access_headers )
@@ -103,15 +103,15 @@ def test_custom_header_type(app):
103103 response = test_client .get ('/protected' , headers = access_headers )
104104 assert response .status_code == 200
105105 assert response .get_json () == {'foo' : 'bar' }
106-
106+
107107 # Ensure new headers work with multiple field values
108- access_headers = {'Authorization' : 'JWT {}, Basic randomcredshere ' .format (access_token )}
108+ access_headers = {'Authorization' : 'JWT {}, Basic creds ' .format (access_token )}
109109 response = test_client .get ('/protected' , headers = access_headers )
110110 assert response .status_code == 200
111111 assert response .get_json () == {'foo' : 'bar' }
112112
113113 # Ensure new headers work with multiple field values in any position
114- access_headers = {'Authorization' : 'Basic randomcredshere , JWT {}' .format (access_token )}
114+ access_headers = {'Authorization' : 'Basic creds , JWT {}' .format (access_token )}
115115 response = test_client .get ('/protected' , headers = access_headers )
116116 assert response .status_code == 200
117117 assert response .get_json () == {'foo' : 'bar' }
0 commit comments