Python 3 fix: DeprecationWarning: Please use assertRaisesRegex instead