Projet

Général

Profil

0001-python3-handle-basic-authz-header-encoding-in-tests-.patch

Paul Marillonnet, 01 avril 2019 19:36

Télécharger (920 octets)

Voir les différences:

Subject: [PATCH] python3: handle basic authz header encoding in tests (#31175)

 tests/utils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
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')).decode('ascii')
60
    return {'Authorization': 'Basic %s' % b64cred}
61

  
60 62

  
61 63

  
62 64
def get_response_form(response, form='form'):
63
-