summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-02-01 22:41:23 +0100
committerMartin Basti <mbasti@redhat.com>2017-02-02 13:43:16 +0100
commit5de70e31999eb219bd47aa81b0c003a6c15cf748 (patch)
treecedaa9aa7304fa1cf067dc2fff63639bf88f3457 /ipatests/test_xmlrpc
parentcaca181d3b73c045abd72e464a195c6b61c251c7 (diff)
downloadfreeipa-5de70e31999eb219bd47aa81b0c003a6c15cf748.tar.gz
freeipa-5de70e31999eb219bd47aa81b0c003a6c15cf748.tar.xz
freeipa-5de70e31999eb219bd47aa81b0c003a6c15cf748.zip
py3: tests_xmlrpc: do not call str() on bytes
Calling str() on bytes causes undesired side effect: it adds prefix "b" to the result of conversion. The method decode() should be used instead. https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc')
-rw-r--r--ipatests/test_xmlrpc/test_caacl_profile_enforcement.py2
-rw-r--r--ipatests/test_xmlrpc/test_kerberos_principal_aliases.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py b/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py
index e5cf09157..fa474c64a 100644
--- a/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py
+++ b/ipatests/test_xmlrpc/test_caacl_profile_enforcement.py
@@ -434,7 +434,7 @@ def santest_csr(request, santest_host_1, santest_host_2):
pkey, hashes.SHA256(), backend
).public_bytes(serialization.Encoding.PEM)
- return unicode(csr)
+ return csr.decode('ascii')
class SubjectAltNameOneServiceBase(XMLRPC_test):
diff --git a/ipatests/test_xmlrpc/test_kerberos_principal_aliases.py b/ipatests/test_xmlrpc/test_kerberos_principal_aliases.py
index a1973af2c..9f062ccdf 100644
--- a/ipatests/test_xmlrpc/test_kerberos_principal_aliases.py
+++ b/ipatests/test_xmlrpc/test_kerberos_principal_aliases.py
@@ -260,7 +260,7 @@ class TestKerberosAliasExceptions(XMLRPC_test):
# Add an alias overlapping the UPN of a trusted domain
upn_suffix = (
trusted_domain_with_suffix['ldif']['ipaNTAdditionalSuffixes']
- )
+ ).decode('utf-8')
with pytest.raises(errors.ValidationError):
krbalias_user.add_principal(
@@ -278,7 +278,7 @@ class TestKerberosAliasExceptions(XMLRPC_test):
# Add an alias overlapping the NETBIOS name of a trusted domain
netbios_name = (
trusted_domain_with_suffix['ldif']['ipaNTFlatName']
- )
+ ).decode('utf-8')
with pytest.raises(errors.ValidationError):
krbalias_user.add_principal(