0001-python3-handle-basic-authz-header-encoding-in-tests-.patch
tests/utils.py | ||
---|---|---|
55 | 55 | |
56 | 56 | |
57 | 57 |
def basic_authorization_header(user, password=None): |
58 |
cred = base64.b64encode('%s:%s' % (user.username, password or user.username)) |
|
59 |
return {'Authorization': 'Basic %s' % cred} |
|
58 |
cred = '%s:%s' % (user.username, password or user.username) |
|
59 |
b64cred = base64.b64encode(cred.encode('utf-8')) |
|
60 |
if six.PY3: |
|
61 |
b64cred = b64cred.decode('ascii') |
|
62 |
return {'Authorization': 'Basic %s' % b64cred} |
|
60 | 63 | |
61 | 64 | |
62 | 65 |
def get_response_form(response, form='form'): |
63 |
- |