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:
This bug was referenced in samba v4-18-stable (Release samba-4.18.2):