This commit is contained in:
Martin
2016-06-30 17:31:58 +02:00
parent 032b417e1d
commit 77634ae303
15 changed files with 41 additions and 23 deletions
+3 -2
View File
@@ -16,7 +16,8 @@ class TestHttpBasicAuth(flask_testing.TestCase):
self.app.config['API_KEYS'] = [self.api_key]
def _create_auth_headers(self, username, password=''):
data = base64.b64encode(bytes(':'.join([username, password]), 'ascii')).decode('ascii')
data = base64.b64encode(
bytes(':'.join([username, password]), 'ascii')).decode('ascii')
headers = [('Authorization', 'Basic %s' % data)]
return headers
@@ -33,4 +34,4 @@ class TestHttpBasicAuth(flask_testing.TestCase):
def test_basic_auth_disabled(self):
response = self.client.get('/')
self.assert200(response)
self.assert200(response)