Python: Fix missing `assertRaisesRegexp` method in Python 3.12
Some manual tests uses [assertRaisesRegex](https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex) method, that's named `assertRaisesRegexp` in Python 2 (and that name is used). If we want to continue support Python 2, then we should use the fix, described in [this SO answer](https://stackoverflow.com/questions/61192719/how-can-i-call-unittest-assertraisesregex-from-code-that-supports-both-python-2):

```python
# Add that code somewhere in the test
if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
    setattr(unittest.TestCase, 'assertRaisesRegex', unittest.TestCase.assertRaisesRegexp)
```