operation=FLAG_MOD_REPLACE)
except ldb.LdbError as e:
(num, msg) = e.args
- self.fail("Failed to change user into a workstation: {msg}")
+ self.fail(f"Failed to change user into a workstation: {msg}")
self.assertIsNone(user.get_resultant_PSO())
try:
operation=FLAG_MOD_REPLACE)
except ldb.LdbError as e:
(num, msg) = e.args
- self.fail("Failed to change user back into a user: {msg}")
+ self.fail(f"Failed to change user back into a user: {msg}")
self.assertTrue(user.get_resultant_PSO() == dummy_pso.dn)
# no PSO should be returned if RID is equal to DOMAIN_USER_RID_KRBTGT
ldb.FLAG_MOD_REPLACE, "userAccountControl")
self.assertRaisesLdbError([ldb.ERR_OBJECT_CLASS_VIOLATION,
ldb.ERR_UNWILLING_TO_PERFORM],
- f"Unexpectedly able to set userAccountControl to be an Normal "
- "account without |UF_PASSWD_NOTREQD Unexpectedly able to "
- "set userAccountControl to be a workstation on {m.dn}",
+ "Unexpectedly able to set userAccountControl to be a Normal "
+ "account without |UF_PASSWD_NOTREQD",
self.samdb.modify, m)
UF_TRUSTED_FOR_DELEGATION),
ldb.FLAG_MOD_REPLACE, "userAccountControl")
self.assertRaisesLdbError(ldb.ERR_OTHER,
- f"Unexpectedly able to set userAccountControl to "
+ "Unexpectedly able to set userAccountControl to "
"UF_WORKSTATION_TRUST_ACCOUNT|UF_PARTIAL_SECRETS_ACCOUNT|"
- "UF_TRUSTED_FOR_DELEGATION on {m.dn}",
+ f"UF_TRUSTED_FOR_DELEGATION on {m.dn}",
self.admin_samdb.modify, m)
m = ldb.Message()
self.admin_samdb.add(msg_dict)
if (objectclass == "user"
and account_type != UF_NORMAL_ACCOUNT):
- self.fail("Able to create {account_type_str} on {objectclass}")
+ self.fail(f"Able to create {account_type_str} on {objectclass}")
except LdbError as e:
(enum, estr) = e.args
self.assertEqual(enum, ldb.ERR_OBJECT_CLASS_VIOLATION)
self.assertRaisesLdbError([ldb.ERR_OBJECT_CLASS_VIOLATION,
ldb.ERR_UNWILLING_TO_PERFORM],
- "Should have been unable Able to change objectclass of a {objectclass}",
+ f"Should have been unable to change objectclass of a {objectclass}",
self.admin_samdb.modify, m)
runner = SubunitTestRunner()