summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-11-05 09:38:23 +0000
committerNoel Power <npower@samba.org>2018-12-10 10:38:21 +0100
commit679b640ac5e4da883d30be50cbf5c2efc7515774 (patch)
tree4d7ed285c0943c1c678969f8892268541e260cfc /python
parent00133791d542f3c89aa4b7c2272d2150a252c3ab (diff)
downloadsamba-679b640ac5e4da883d30be50cbf5c2efc7515774.tar.gz
python/samba/tests: Py3 port for samba.tests.auth_log_netlogon_bad_creds.samba
fix unicode doesn't exist error in PY3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/auth_log_netlogon_bad_creds.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/samba/tests/auth_log_netlogon_bad_creds.py b/python/samba/tests/auth_log_netlogon_bad_creds.py
index a0a2e2885f8..d850bd1c1b4 100644
--- a/python/samba/tests/auth_log_netlogon_bad_creds.py
+++ b/python/samba/tests/auth_log_netlogon_bad_creds.py
@@ -37,6 +37,7 @@ from samba.tests import delete_force
from samba.dsdb import UF_WORKSTATION_TRUST_ACCOUNT, UF_PASSWD_NOTREQD
from samba.dcerpc.misc import SEC_CHAN_WKSTA
from samba.dcerpc.netlogon import NETLOGON_NEG_STRONG_KEYS
+from samba.compat import get_string
class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase):
@@ -60,9 +61,7 @@ class AuthLogTestsNetLogonBadCreds(samba.tests.auth_log_base.AuthLogTestBase):
self.dn = ("cn=%s,cn=users,%s" %
(self.netbios_name, self.base_dn))
- utf16pw = unicode(
- '"' + self.machinepass.encode('utf-8') + '"', 'utf-8'
- ).encode('utf-16-le')
+ utf16pw = get_string('"' + self.machinepass + '"').encode('utf-16-le')
self.ldb.add({
"dn": self.dn,
"objectclass": "computer",