Fix encoding issue.
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
# remove the account if it exists, this will happen if a previous test
# run failed
delete_force(self.ldb, self.machine_dn)
-
- utf16pw = unicode(
- '"' + self.machine_pass.encode('utf-8') + '"', 'utf-8'
- ).encode('utf-16-le')
+ # get unicode str for both py2 and py3
+ pass_unicode = self.machine_pass.encode('utf-8').decode('utf-8')
+ utf16pw = u'"{}"'.format(pass_unicode).encode('utf-16-le')
self.ldb.add({
"dn": self.machine_dn,
"objectclass": "computer",
planoldpythontestsuite("ad_dc_ntvfs",
"samba.tests.krb5_credentials",
+ py3_compatible=True,
extra_args=['-U"$USERNAME%$PASSWORD"'])
+
for env in ["ad_dc_ntvfs", "vampire_dc", "promoted_dc"]:
planoldpythontestsuite(env,
"samba.tests.py_credentials",