assertNotEquals and assertRegexpMatches were removed in Python 3.12 so we need to stop using them or risk being caught unable to test old Samba versions on modern systems.
Is this to backport 41aa379abb391ffab77238d65ee5ba11b9ab8538?
Yes, as that is needed for bug #15316
This bug was referenced in samba v4-18-test: e9f5d1c03bcb800fc6e01a11c49cf5c193d6a00c
This bug was referenced in samba v4-18-stable (Release samba-4.18.2): e9f5d1c03bcb800fc6e01a11c49cf5c193d6a00c