@@ -160,7 +160,7 @@ def test_create_attribute_query1(self):
160
160
"E8042FB4-4D5B-48C3-8E14-8EDD852790DD" ,
161
161
format = saml .NAMEID_FORMAT_PERSISTENT ,
162
162
message_id = "id1" )
163
- reqstr = "%s" % req .to_string ()
163
+ reqstr = "%s" % req .to_string (). decode ( 'utf-8' )
164
164
165
165
assert req .destination == "https://idp.example.com/idp/"
166
166
assert req .id == "id1"
@@ -335,7 +335,7 @@ def test_response_1(self):
335
335
336
336
resp_str = "%s" % resp
337
337
338
- resp_str = base64 .encodestring (resp_str )
338
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
339
339
340
340
authn_response = self .client .parse_authn_request_response (
341
341
resp_str , BINDING_HTTP_POST ,
@@ -377,7 +377,7 @@ def test_response_1(self):
377
377
378
378
authn = AUTHN )
379
379
380
- resp_str = base64 .encodestring (resp_str )
380
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
381
381
382
382
self .client .parse_authn_request_response (
383
383
resp_str , BINDING_HTTP_POST ,
@@ -427,7 +427,7 @@ def test_response_2(self):
427
427
428
428
resp_str = "%s" % resp
429
429
430
- resp_str = base64 .encodestring (resp_str )
430
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
431
431
432
432
authn_response = _client .parse_authn_request_response (
433
433
resp_str , BINDING_HTTP_POST ,
@@ -462,7 +462,7 @@ def test_response_3(self):
462
462
463
463
resp_str = "%s" % resp
464
464
465
- resp_str = base64 .encodestring (resp_str )
465
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
466
466
467
467
authn_response = _client .parse_authn_request_response (
468
468
resp_str , BINDING_HTTP_POST ,
@@ -497,7 +497,7 @@ def test_response_4(self):
497
497
498
498
resp_str = "%s" % resp
499
499
500
- resp_str = base64 .encodestring (resp_str )
500
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
501
501
502
502
authn_response = _client .parse_authn_request_response (
503
503
resp_str , BINDING_HTTP_POST ,
@@ -541,7 +541,7 @@ def test_response_5(self):
541
541
542
542
resp_str = "%s" % resp
543
543
544
- resp_str = base64 .encodestring (resp_str )
544
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
545
545
546
546
authn_response = _client .parse_authn_request_response (
547
547
resp_str , BINDING_HTTP_POST ,
@@ -594,7 +594,7 @@ def test_response_6(self):
594
594
595
595
resp_str = "%s" % resp
596
596
597
- resp_str = base64 .encodestring (resp_str )
597
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
598
598
599
599
authn_response = _client .parse_authn_request_response (
600
600
resp_str , BINDING_HTTP_POST ,
@@ -629,7 +629,7 @@ def test_response_7(self):
629
629
630
630
resp_str = "%s" % resp
631
631
632
- resp_str = base64 .encodestring (resp_str )
632
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
633
633
634
634
authn_response = _client .parse_authn_request_response (
635
635
resp_str , BINDING_HTTP_POST ,
@@ -672,7 +672,7 @@ def test_response_8(self):
672
672
673
673
resp_str = "%s" % resp
674
674
675
- resp_str = base64 .encodestring (resp_str )
675
+ resp_str = base64 .encodestring (resp_str . encode ( 'utf-8' ) )
676
676
677
677
authn_response = _client .parse_authn_request_response (
678
678
resp_str , BINDING_HTTP_POST ,
@@ -904,7 +904,7 @@ def test_sign_then_encrypt_assertion_advice_1(self):
904
904
905
905
#seresp = samlp.response_from_string(enctext)
906
906
907
- resp_str = base64 .encodestring (enctext )
907
+ resp_str = base64 .encodestring (enctext . encode ( 'utf-8' ) )
908
908
# Now over to the client side
909
909
resp = self .client .parse_authn_request_response (
910
910
resp_str , BINDING_HTTP_POST ,
@@ -1138,7 +1138,7 @@ def test_sign_then_encrypt_assertion_advice_2(self):
1138
1138
1139
1139
#seresp = samlp.response_from_string(enctext)
1140
1140
1141
- resp_str = base64 .encodestring ("%s" % response )
1141
+ resp_str = base64 .encodestring (str ( response ). encode ( 'utf-8' ) )
1142
1142
# Now over to the client side
1143
1143
resp = self .client .parse_authn_request_response (
1144
1144
resp_str , BINDING_HTTP_POST ,
0 commit comments