Use assertRaisesRegexp in error message testing.