Assert the actual exception error message.
Mock the warnings.warn function and assert that the warnings are actually
emitted.